使用支持库搜索栏的Holo主题 [英] SeekBar Holo Theme using Support Library

查看:190
本文介绍了使用支持库搜索栏的Holo主题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是 Android的支持库 V4和V7得到片段,刷卡,就能查看传呼机,甚至是动作条!它的工作原理和图形都很好!

不过虽然图形上面看起来不错,并在Android的2.X和Android 4.x版保持一致,一些常见的小部件看起来版本之间有很大不同。这导致颜色不匹配,在应用程序中与其它外观一致的用户界面 - 所以不管我画在UI的其余部分,无论是黄色搜索栏或蓝色搜索栏将不匹配的东西。

我想支持库的整点是让跨平台一致的用户界面,并停止需要第三方库,如 ActionBarSherlock HoloEverywhere

我似乎无法找到这是否是谷歌如何想我的搜索栏的样子还是我做错了什么:

 我的搜索栏上看起来的Andr​​oid 4.x的相当不错:

 唉,同样的搜索栏看起来日在Android 2.X:


解决方案

  

我似乎无法找到这是否是谷歌如何想我的搜索栏的样子还是我做错了什么:


不,你没有做错什么。它的工作按预期。如果你想在不同的Andr​​oid版本的UI元素的一致性,你需要使用 ActionBarSherlock 和可选的 HoloEverywhere

另一个选择是 Android的全息色彩发电机。你可以挑选你想和一个颜色,这widget和它将生成ICS主题的资产和风格为您服务。您可以根据需要然后将它们添加到您的项目。

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:

解决方案

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.

这篇关于使用支持库搜索栏的Holo主题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆