Android 边框圆角
来源:互联网 发布:python frombuffer 编辑:程序博客网 时间:2024/05/21 16:19
设置边框圆角可以在drawable-mdpi目录里定义一个xml:
解释:solid的表示填充颜色,为了简单,这里用的是黑色。
而corners则是表示圆角,注意的是这里bottomRightRadius是左下角而不是右下角,bottomLeftRadius右下角。
当然上面的效果也可以像下面一样设置,如下:
如果想引用这个xml,只需要@drawable/corners_bg.xml即可:
main.xml:
运行结果:
- <?xml version="1.0" encoding="utf-8"?>
- <shape xmlns:android="http://schemas.android.com/apk/res/android">
- <solid android:color="#000000" />
- <corners android:topLeftRadius="10dp"
- android:topRightRadius="10dp"
- android:bottomRightRadius="10dp"
- android:bottomLeftRadius="10dp"/>
- </shape>
解释:solid的表示填充颜色,为了简单,这里用的是黑色。
而corners则是表示圆角,注意的是这里bottomRightRadius是左下角而不是右下角,bottomLeftRadius右下角。
当然上面的效果也可以像下面一样设置,如下:
- <corners android:radius="5dp" />
如果想引用这个xml,只需要@drawable/corners_bg.xml即可:
- android:background="@drawable/corners_bg"
main.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" android:background="#FFFFFF">
- <RelativeLayout android:id="@+id/login_div"
- android:layout_width="fill_parent" android:layout_height="150dip"
- android:padding="15dip" android:layout_margin="15dip"
- android:background="@drawable/corners_bg">
- </RelativeLayout>
- </LinearLayout>
运行结果:
via:http://iaiai.iteye.com/blog/1102958
0 0
- android圆角边框
- Android边框圆角
- Android 边框圆角
- android 边框圆角
- Android圆角边框
- Android 圆角边框
- Android 边框圆角
- 2. android 边框圆角
- Android实现边框圆角
- Android 圆角边框实现
- android 设置边框圆角
- Android实现圆角边框
- android实现边框圆角
- Android实现圆角边框
- Android实现边框圆角
- Android:圆角和边框
- Android实现圆角边框
- android实现边框圆角
- file
- ITU-RBT.656视频标准接口SAV/EAV分析
- js实时统计文本框中输入文字的个数
- Spring加载多个配置文件
- 简约至上-交互设计四策略-《明确认识》
- Android 边框圆角
- 从Java视角理解伪共享系列文章
- 关于架构师(删繁就精)
- 程序猿找工作必练内功:排序算法大总结(一)——简单排序算法
- ubuntu等Linux系统为firefox浏览器安装adobe flash player
- udev 和 mdev 总结
- Android开发之旅:环境搭建及HelloWorld
- ZOJ-1622
- 在Active Server Pages中使用JScript