Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to make a TextView look like a Setting's PreferenceCategory Header
    primarykey
    data
    text
    <p>This should be something pretty easy to figure out, but I've just not been able to find the answer anywhere. </p> <p>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: </p> <p><img src="https://i.stack.imgur.com/aNsLG.jpg" alt="Preference Category Header"></p> <p>Now, I have tried a few things, but I seem not to get it right. For example, I tried setting this: </p> <pre><code>android:drawableBottom="?android:attr/dividerVertical" </code></pre> <p>to my TextView, but that seems not to do anything at all, and my TextView Still looks like this: </p> <p><img src="https://i.stack.imgur.com/bCetQ.jpg" alt="Image not looking correctly"></p> <p>I've also tried simply setting a drawable I made: </p> <pre><code>&lt;shape xmlns:android="http://schemas.android.com/apk/res/android"&gt; &lt;stroke android:width="1dp" android:color="@android:color/darker_gray" /&gt; &lt;/shape&gt; </code></pre> <p>But That didn't come up on my text either. </p> <p>This is the TextView style for now:</p> <pre><code> &lt;style name="NewTaskHeaderText"&gt; &lt;item name="android:layout_height"&gt;wrap_content&lt;/item&gt; &lt;item name="android:layout_width"&gt;match_parent&lt;/item&gt; &lt;item name="android:textColor"&gt;@android:color/holo_blue_dark&lt;/item&gt; &lt;item name="android:minHeight"&gt;48dp&lt;/item&gt; &lt;item name="android:gravity"&gt;center_vertical&lt;/item&gt; &lt;item name="android:padding"&gt;8dp&lt;/item&gt; &lt;/style&gt; &lt;TextView android:id="@+id/textView4" style="@style/NewTaskHeaderText" android:drawableBottom="@android:attr/dividerVertical" android:text="@string/some_text" android:textAppearance="?android:attr/textAppearanceMedium" /&gt; </code></pre> <p>Any ideas would be appreciated. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload