Android 4.0子标题(部分)标签样式 [英] Android 4.0 Sub-Title (section) Label Styling
本文介绍了Android 4.0子标题(部分)标签样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
所以我正在查看ICS的所有 Android开发设计网站应用程序有这些字幕/部分标题:
So I was looking at the Android Dev Design site for ICS and all of the apps have these subtitles/section headers:
我想知道是否有人知道自定义样式来实现这样的标签。我找不到任何标签在Android SDK中看起来像这样的视图,但我真的很喜欢这些样子。
I was wondering if anyone knew the custom styling to achieve labels that look like this. I couldn't find any label Views that looked like this in the Android SDK but I really like the way these look.
感谢提前!
推荐答案
所以这是我最后使用的:
So this is what I ended up using:
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="sectionHeader" parent="android:Widget.Holo.Light.TextView">
<item name="android:drawableBottom">@drawable/section_header</item>
<item name="android:drawablePadding">4dp</item>
<item name="android:layout_marginTop">8dp</item>
<item name="android:paddingLeft">4dp</item>
<item name="android:textAllCaps">true</item>
<item name="android:textColor">@color/emphasis</item>
<item name="android:textSize">14sp</item>
</style>
</resources>
其中@ drawable / section_header是:
Where @drawable/section_header is:
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<size android:width="1000dp" android:height="2dp" />
<solid
android:color="@color/emphasis"/>
</shape>
和@ color's:
And @color's:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="emphasis">#31b6e7</color>
<color name="bg_gray">#cecbce</color>
</resources>
这篇关于Android 4.0子标题(部分)标签样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文