The Android Design - Lists page describes "section dividers". I'm aware you can use addHeaderView()
a ListView
for a similar effect. I would like to use a "section divider" without a ListView
, but rather a LinearLayout
.
In the screenshot below, I'm referring to the blue text "Phone" and "Email" which also has an line below it. The screenshot is from Android Design - Text Fields
How do I go about adding it to my layout? It it simply a TextView plus a horizontal line?
I was looking for the same issue. I found an easy way to tell the app that a texview is a section separator:
<TextView
android:id="@+id/address_label"
style="?android:attr/listSeparatorTextViewStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Address"/>
The line:
style="?android:attr/listSeparatorTextViewStyle"
add the underline to the text and style it accordingli to the defaulf "Separator" theme.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With