How to make a TextView look like a Setting's PreferenceCategory Header
android, android-preferences, textview
Solution
<TextView
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:text="foo"
style="?android:attr/listSeparatorTextViewStyle" />
To do even more, look at this other SO answer
Problem
This should be something pretty easy to figure out, but I've just not been able to find the answer anywhere. I am trying to make a regular TextView look very similar, to the Preference Category Headers presented on Settings for any app. Here's what I mean: Now, I have tried a few things, but I seem not to get it right. For example, I tried setting this: ``` android:drawableBottom="?android:attr/dividerVertical" ``` to my TextView, but that seems not to do anything at all, and my TextView Still looks like this: I've also tried simply setting a drawable I made: ``` <shape xmlns:android="http://schemas.android.com/apk/res/android"> <stroke android:width="1dp" android:color="@android:color/darker_gray" /> </shape> ``` But That didn't come up on my text either. This is the TextView style for now: ``` <style name="NewTaskHeaderText"> <item name="android:layout_height">wrap_content</item> <item name="android:layout_width">match_parent</item> <item name="android:textColor">@android:color/holo_blue_dark</item> <item name="android:minHeight">48dp</item> <item name="android:gravity">center_vertical</item> <item name="android:padding">8dp</item> </style> <TextView android:id="@+id/textView4" style="@style/NewTaskHeaderText" android:drawableBottom="@android:attr/dividerVertical" android:text="@string/some_text" android:textAppearance="?android:attr/textAppearanceMedium" /> ``` Any ideas would be appreciated.