user1437481
user1437481

Reputation: 470

Android Preference Category

Hello i would like to use preferencecategory(with the underline etc) style on a TextView, which style/settings should I implement on the xml?

Thank you

Upvotes: 0

Views: 1978

Answers (1)

SSemashko
SSemashko

Reputation: 1497

The thing you can do is to set your custom layout for PreferenceCategory with android:layout

<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>

Upvotes: 1

Related Questions