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

android 布局中的间隔线

如果是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>

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-22
  • 2021-08-13
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-10
  • 2021-06-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-17
  • 2022-12-23
相关资源
相似解决方案