Android 4.0的副标题(部分)标签样式 [英] Android 4.0 Sub-Title (section) Label Styling

查看:610
本文介绍了Android 4.0的副标题(部分)标签样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我一直在寻找在 Android开发设计网站为ICS和所有的应用程序有这些字幕/节标题:

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>

在哪里@可绘制/ 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>

和@色的:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="emphasis">#31b6e7</color>
    <color name="bg_gray">#cecbce</color>
</resources>

这篇关于Android 4.0的副标题(部分)标签样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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