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]
 

Android 一条竖线或横线、画边框的更多相关文章

  1. CSS实现画一条竖线

    在开发中遇到一种需求:画一条竖线. 横线倒是很好画,直接<hr/>就可以了.但是竖线没有这么现成的标签,囧囧囧~ 在网上搜索了很多资料,莫衷一是,也没有什么可信的结果. 1.原来这就是竖线 ...

  2. android中利用view画出一条竖线

    在android中有时候需要通过线条来分割控件.最常见的情形就是在底部选项卡的多个button中间,通过加入一条竖线加以区分或者是在头部导航添加 竖线,将返回键和其他内容区分开来.一般会通过image ...

  3. Android学习(六) 文本框边框

    BorderTextViews.java package xiaosi.BorderTextView; import android.content.Context; import android.g ...

  4. WPF 通过Border来画边框

    WPF有自己的表格控件DataGrid.ListBox等,如果只是简单的需求,可以通过Border控件来画边框. 比如我们需要给上面的控件加上边框. <Window x:Class=" ...

  5. 多种的android进度条的特效源码

    多种的android进度条的特效源码,这个源码是在源码天堂那个网站上转载过来的,我已经修改一部分了,感觉很实用的,大家可以学习一下吧,我就不上传源码了,大家可以直接到那个网站上下载吧. 源码天堂下载地 ...

  6. jQuery去掉导航分割线的最后一条竖线

    #top #navigation ul li { float:left; width:120px; background:url(../images/navline.jpg) no-repeat 11 ...

  7. android进度条

    android进度条 1.达到的效果 2.布局代码 先写一个my_browser.xml文件 存放WebView <?xml version="1.0" encoding=& ...

  8. c语言中一条竖线是什么符号?

    "|"在C语言中表示按位或,是双目运算符.其功能是参与运算的两数各对应的二进位(也就是最后一位)相或.只要对应的二个二进位有一个为1时,结果位就为1.参与运算的两个数均以补码出现. ...

  9. iOS开发--画一条黑色的横线

    在网上搜索了下大概有下面几种方法: 1.使用Quartz2D画出横线 需要一个UIVIew把这两个Label装起来,你需要计算好他们的位置同时给黑线预留像素的位置.这样你在UIView里面- (voi ...

随机推荐

  1. 【BZOJ2395】【Balkan 2011】Timeismoney 最小乘积生成树

    链接: #include <stdio.h> int main() { puts("转载请注明出处[辗转山河弋流歌 by 空灰冰魂]谢谢"); puts("网 ...

  2. hackerrank-knapsack

    https://www.hackerrank.com/challenges/unbounded-knapsack 题目描述: #include <iostream> #include &l ...

  3. Android应用的基本原理

    原文:http://android.eoe.cn/topic/android_sdk 应用基础-Application Fundamentals Android应用程序以java作为开发语言.用And ...

  4. 解决 slf4j + log4j 在云服务上打印乱码

    由于云服务器的环境是纯英文的 虽然在eclipse中可以打印日志显示中文,但是实用putty的时候查看却是乱码,下载日志也同样是乱码 那么只要设置utf-8即可

  5. Atitit 项目的主体设计与结构文档 v5

    Atitit 项目的主体设计与结构文档 v5 1. 版本历史说明2 2. 功能大概说明2 3. 实现的目标3 3.1. cross device跨设备(pc 手机 平板)3 3.2. cross sc ...

  6. golang 解决 TCP 粘包问题

    什么是 TCP 粘包问题以及为什么会产生 TCP 粘包,本文不加讨论.本文使用 golang 的 bufio.Scanner 来实现自定义协议解包. 协议数据包定义 本文模拟一个日志服务器,该服务器接 ...

  7. linux:文件及文件夹管理

    http://blog.csdn.net/pipisorry/article/details/39854265 查看用户的信息 pika:~$id pikauid=1000(pika) gid=100 ...

  8. hdu 1879 继续通畅工程(最小生成树)

    题目:http://acm.hdu.edu.cn/showproblem.php?pid=1879 /************************************************* ...

  9. mysql protocol

    http://hutaow.com/blog/2013/11/06/mysql-protocol-analysis/ https://dev.mysql.com/doc/internals/en/cl ...

  10. 15个Spring的核心注释示例

    众所周知,Spring DI和Spring IOC是Spring Framework的核心概念.让我们从org.springframework.beans.factory.annotation和org ...