1、画线 
[img] 
http://pic002.cnblogs.com/images/2010/122963/2010122216290992.png 
[/img]

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

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3. android:layout_width="fill_parent"
  4. android:layout_height="fill_parent"
  5. android:orientation="vertical" >
  6. <TextView
  7. android:id="@+id/textView01"
  8. android:layout_width="fill_parent"
  9. android:layout_height="wrap_content"
  10. android:autoLink="all"
  11. android:text="博客:http://www.baidu.com" />
  12. <TextView
  13. android:id="@+id/myTextView01"
  14. android:layout_width="fill_parent"
  15. android:layout_height="wrap_content"
  16. android:text="@string/str_textview01" />
  17. <View
  18. android:layout_width="fill_parent"
  19. android:layout_height="2dip"
  20. android:background="#FF909090" />
  21. <TextView
  22. android:id="@+id/myTextView02"
  23. android:layout_width="fill_parent"
  24. android:layout_height="wrap_content"
  25. android:text="@string/str_textview02" />
  26. <View
  27. android:layout_width="fill_parent"
  28. android:layout_height="2dip" />
  29. </LinearLayout>

原文 http://www.cnblogs.com/snowdrop/articles/1914010.html

2、边框

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <shape xmlns:android="http://schemas.android.com/apk/res/android" >
  3. <solid android:color="#FFFFFF" />
  4. <stroke
  5. android:width="1dp"
  6. android:color="#000000" />
  7. <padding
  8. android:bottom="1dp"
  9. android:left="1dp"
  10. android:right="1dp"
  11. android:top="1dp" />
  12. </shape>
  1. <LinearLayout
  2. android:id="@+id/completed_wrap"
  3. android:layout_width="33dip"
  4. android:layout_height="wrap_content"
  5. android:background="@drawable/border"
  6. android:gravity="center"
  7. android:orientation="horizontal" >
  8. </LinearLayout>
  9. 原文 [url]http://blog.csdn.net/hlily2005/article/details/6005969[/url]
 
04-28 16:09