SeekBar Holo Theme using Support Library

大城市里の小女人 提交于 2019-12-22 10:17:20

问题


I am using the Android Support Library v4 and v7 to get Fragments, Swipe-able View Pagers, and even ActionBar! It works and the graphics are really nice!

However while the graphics for the above look nice and consistent in Android 2.x and Android 4.x, some common widgets look very different between versions. This leads to colours mismatch inside the app with an otherwise consistent look UI - so no matter what I draw in the rest of the UI, either the yellow SeekBar or blue SeekBar won't match something.

I thought the whole point of the support library is to get a consistent UI across platforms, and stop needing 3rd party libraries such as ActionBarSherlock or HoloEverywhere!

I can't seem to find whether this is how Google wants my SeekBar to look like or am I doing something wrong:

My SeekBar looks quite nice on Android 4.x:

Alas, the very same SeekBar looks dated on Android 2.x:


回答1:


I can't seem to find whether this is how Google wants my SeekBar to look like or am I doing something wrong:

Nope, you're not doing anything wrong. It's working as intended. If you want consistency with your UI elements across different Android versions, you need to use ActionBarSherlock and optionally HoloEverywhere.

Another option is the Android Holo Colors Generator. You can pick and choose which widgets you want as well as a color and it will generate the ICS themed assets and styles for you. You can then add them to your project as needed.




回答2:


The point of the support library is to give your app a consistent Android feel across all devices. In other words, the same slider would be used across all Android apps that are running on a specific version of Android. So, what you are seeing is what you would expect. The spinner is consistent for the Android version, not for your app.

To make the same slider for all versions of Android, you need to create your own custom component. Here's a good article. It seems difficult at first, but once you get it working, you'll realize it's not so bad.



来源:https://stackoverflow.com/questions/18216963/seekbar-holo-theme-using-support-library

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!