gpt4 book ai didi

Android 4.0 子标题(部分)标签样式

转载 作者:IT老高 更新时间:2023-10-28 13:18:00 24 4
gpt4 key购买 nike

所以我在看 Android Dev Design site对于 ICS 和所有应用程序都有这些字幕/节标题:

ICS Section Headers

我想知道是否有人知道自定义样式来实现看起来像这样的标签。我在 Android SDK 中找不到任何类似这样的标签 View ,但我真的很喜欢它们的外观。

提前致谢!

最佳答案

所以这就是我最终使用的:

<?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 在哪里:

<?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的:

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

关于Android 4.0 子标题(部分)标签样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10020466/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com