博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Android 一条竖线或横线、画边框
阅读量:6708 次
发布时间:2019-06-25

本文共 1682 字,大约阅读时间需要 5 分钟。

博客分类:
  •  
 
1、画线 
[img] 
http://pic002.cnblogs.com/images/2010/122963/2010122216290992.png 
[/img] 
如果是LinearLayout布局,必须要在<View/>的属性里面指定宽和高两个属性,否则就会出错,如果是TableLayout布局,只需要指定高这个属性就可以了 
Xml代码  
  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.   
  7.     <TextView  
  8.         android:id="@+id/textView01"  
  9.         android:layout_width="fill_parent"  
  10.         android:layout_height="wrap_content"  
  11.         android:autoLink="all"  
  12.         android:text="博客:http://www.baidu.com" />  
  13.   
  14.     <TextView  
  15.         android:id="@+id/myTextView01"  
  16.         android:layout_width="fill_parent"  
  17.         android:layout_height="wrap_content"  
  18.         android:text="@string/str_textview01" />  
  19.   
  20.     <View  
  21.         android:layout_width="fill_parent"  
  22.         android:layout_height="2dip"  
  23.         android:background="#FF909090" />  
  24.   
  25.     <TextView  
  26.         android:id="@+id/myTextView02"  
  27.         android:layout_width="fill_parent"  
  28.         android:layout_height="wrap_content"  
  29.         android:text="@string/str_textview02" />  
  30.   
  31.     <View  
  32.         android:layout_width="fill_parent"  
  33.         android:layout_height="2dip" />  
  34.   
  35. </LinearLayout>  
原文   
2、边框 
Xml代码  
  1. <?xml version="1.0" encoding="UTF-8"?>  
  2. <shape xmlns:android="http://schemas.android.com/apk/res/android" >  
  3.   
  4.     <solid android:color="#FFFFFF" />  
  5.   
  6.     <stroke  
  7.         android:width="1dp"  
  8.         android:color="#000000" />  
  9.   
  10.     <padding  
  11.         android:bottom="1dp"  
  12.         android:left="1dp"  
  13.         android:right="1dp"  
  14.         android:top="1dp" />  
  15.   
  16. </shape>  
Xml代码  
  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.   
  9. </LinearLayout>  
  10.   
  11. 原文 [url]http://blog.csdn.net/hlily2005/article/details/6005969[/url]  
 
你可能感兴趣的文章
windows iphone 传输
查看>>
Unity项目中的资源管理
查看>>
MD5
查看>>
用node写个简单的静态服务器
查看>>
H5前端性能测试小结
查看>>
跟我学习Spring Security--在线宠物商店开发(二)
查看>>
css position: absolute、relative详解
查看>>
Linux下Redis-3.0.7版本的安装以及Redis主备的部署(二)
查看>>
<context:property-placeholder>标签实现参数剥离
查看>>
centos-yum
查看>>
mysqldump备份中恢复单张表
查看>>
Outlook 2013 中的基本任务
查看>>
TCP 建立和关闭
查看>>
EDM营销构成的五个因素详解
查看>>
Vcenter数据采集之maven打包可执行jar血历史
查看>>
ip协议号大全
查看>>
juniper的一些基本命令
查看>>
cocos2d-x学习之CCDictionary中的一个小问题
查看>>
运维少年系列 - ansible and cisco(2)
查看>>
我的友情链接
查看>>