开发者

How do you implement the Honeycomb purple/black gradient PreferencesActivity theme?

I'm using a selector to choose the theme for my PreferencesActivity:

<style name="StandardThemeSelector" parent="android:Theme.Holo">
</style>

The selector is because the app runs in Eclair+, but I want it to use the appropriate theme i开发者_JS百科n Honeycomb.

This selector does make the the Preferences Activity look like the Honeycomb dark style instead of the Gingerbread style. However, the background behind the gray list view is pure black, instead of a purple/black or gray/black gradient. I have seen the purple theme in the system settings and in the browser settings. I have seen a gray variant in the YouTube app.

I have also noticed that the gradient is visible for just an instant as apps open, and the color of the gradient matches the color of that app's preference activity.


To get the bitmap background, you need to turn on hardware accelerated drawing for your activity/app. Also make sure you set android:targetSdkVersion="11" or later.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜