android shape 的使用。
来源:互联网 发布:三维定位算法 编辑:程序博客网 时间:2024/06/05 01:10
android中有个shape作为形状来使用的。如下所示。
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <solid android:color="#df5bf1f6"></solid><corners android:radius="7dp"/><padding android:left="3dp" android:top="3dp" android:right="3dp" android:bottom="3dp"/></shape>
下面介绍一下说一下shape中的属性。
android:shape="rectangle" 这是个设置背景形状总共有一下几种选择
rectangle,line,oval,ring。(矩形,直线,椭圆,圆环)
rectangle的属性有:
<corners/> 圆角
<gradient/> 线性
<padding /> 跟其他的padding意思应该差不多
<size/>
<solid/> 背景
<stroke/>
注意事项:上面那个xml中,如果把把shape 设置成ring 作为背景是会变成全透明的。
不能够用line shape 作为View之类的背景。会提示nullPointerException at android.graphics.Canvas.drawLine(Canvas.java:809)
另外发现网上有篇更详细介绍的:http://www.linuxidc.com/Linux/2011-10/45316.htm
- android:shape的使用
- android:shape的使用
- android:shape的使用
- android:shape的使用
- android:shape的使用
- android:shape的使用
- android:shape的使用
- android:shape的使用
- android:shape的使用
- android:shape的使用
- android shape的使用
- android:shape的使用
- android:shape的使用
- android:shape的使用
- android:shape的使用
- android:shape的使用
- android:shape的使用
- android:shape的使用
- Sichuan University Programming Contest 2013 Final (Single)C题
- 重新配了一下vim
- STM32 (Cortex-M3) 中NVIC(嵌套向量中断控制)的理解
- 2013-04-21 STL之模板编程技巧
- 我的书架
- android shape 的使用。
- URL of SAP Best Practices - All-in-one online version
- Md5加密原理
- android之dom解析xml
- 理解计算机3D图形学中的坐标系变换
- 转贴:让VIM与Ubuntu和睦相处
- 新开通了博客,欢迎大家常来瞧瞧!
- Flatten Binary Tree to Linked List
- eclipse中svn代码冲突解决方案 zz