published: March 28th, 2011
Using an Android View to display a line
Here’s a cool trick I’ve used a couple times to display a horizontal line on the screen between widgets. It uses an Android View with a background color.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
style="@style/WordsOfWisdomText"
android:text="Turn off your lights to safe energy"/>
<View
android:layout_width="fill_parent"
android:layout_height="1px"
android:background="#FF909090" />
<TextView
style="@style/WordsOfWisdomText"
android:text="World peace is a reality"/>
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:background="#FF909090" />
<TextView
style="@style/WordsOfWisdomText"
android:text="Eat your vegetables"/>
</LinearLayout>
