Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/190.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 安卓偏好类别_Android_Android Layout_Android Preferences - Fatal编程技术网

Android 安卓偏好类别

Android 安卓偏好类别,android,android-layout,android-preferences,Android,Android Layout,Android Preferences,您好,我想在TextView上使用preferencecategory(带下划线等)样式,我应该在xml上实现哪些样式/设置 谢谢你你可以做的事情是用android:layout为PreferenceCategory设置自定义布局 <PreferenceCategory android:layout="@layout/prefcat_layout"> ... </PreferenceCategory> ... prefcat_layout.xml: <

您好,我想在TextView上使用preferencecategory(带下划线等)样式,我应该在xml上实现哪些样式/设置


谢谢你

你可以做的事情是用android:layout为PreferenceCategory设置自定义布局

<PreferenceCategory android:layout="@layout/prefcat_layout">
    ...
</PreferenceCategory>

...
prefcat_layout.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >
    <TextView 
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="@string/underlined_title"/>

</LinearLayout>

strings.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="underlined_title"> <u>Underlined Application preferences title</u></string>
</resources>

带下划线的应用程序首选项标题

我没有使用首选项屏幕,因此我无法使用我使用的是常规的relativelayout。