在 PreferenceFragmentCompat 中为 PreferenceCategory 设置标题样式 [英] Set Title style for PreferenceCategory in PreferenceFragmentCompat

查看:43
本文介绍了在 PreferenceFragmentCompat 中为 PreferenceCategory 设置标题样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为我的偏好片段屏幕 V14 设置标题样式.
这就是我想要的:

我已关注

解决方案

SOLVED
我在文本视图周围添加了线性布局,背景在我选择的颜色中可见.
这是代码.

settings_text.xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:tools="http://schemas.android.com/tools"android:layout_width="match_parent"android:layout_height="wrap_content"><文本视图android:id="@android:id/title"style="@style/CustomPreferenceCategoryText"android:layout_width="match_parent"android:layout_height="wrap_content"/></LinearLayout>


style.xml