The Android Design - Lists page describes \"section dividers\". I\'m aware you can use addHeaderView()
a ListView
for a similar effect. I would lik
On request of the asker of this question, I am writing my comment as an answer
Create a background image with a line at the bottom, and set it as background to your TextView.
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.
The solution ended up having an includable layout called util_horizontal_line_section.xml
:
<?xml version="1.0" encoding="utf-8"?>
<View
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="1dip"
android:background="@color/sectionSeparatorColour"/>
With the sectionSeparatorColour
entry in values/colors.xml
:
<color name="sectionSeparatorColour">#a0a0a0</color>
Includable via:
<include layout="@layout/util_horizontal_line_section"/>
Try to put this View after the TextView of "phone". In this view I have put in a background color that you can change to your desire. Best of luck.
<View
android:layout_width="match_parent"
android:layout_height="2dip"
android:background="#FF909090" />
TextView 2dp in height and width = match parent and set the background color as the color you want the line to be.
You can do vertical as well by reversing the two settings.