在显示的视图中加一条间隔线,不像ListView里面的那种虚线,而是一条实线

如果是LinearLayout布局,必须要在<View/>的属性里面指定宽和高两个属性,否则就会出错,如果是TableLayout布局,只需要指定高这个属性就可以了

xml布局如下:

代码
<?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
android:id="@+id/textView01"
android:layout_width
="fill_parent"
android:layout_height
="wrap_content"
android:autoLink
="all"
android:text
="博客:http://www.baidu.com"
/>
<TextView
android:id="@+id/myTextView01"
android:layout_width
="fill_parent"
android:layout_height
="wrap_content"
android:text
="@string/str_textview01"
/>


<View
android:layout_width="fill_parent"
android:layout_height
="2dip"
android:background
="#FF909090"/>
<TextView
android:id="@+id/myTextView02"
android:layout_width
="fill_parent"
android:layout_height
="wrap_content"
android:text
="@string/str_textview02"
/>
<View
android:layout_width="fill_parent"
android:layout_height
="2dip"
/>
</LinearLayout>

posted on 2010-12-22 16:30  snowdrop  阅读(24046)  评论(0编辑  收藏  举报