您的位置:首页 > 其它

记录我的安卓开发之旅——安卓开发笔记一——xml实现圆角布局

2015-08-23 20:33 344 查看
在drawable文件夹下建立Drawable Resource File ,起名xxxxx,生成文件xxxxx.xml

写入如下代码:

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<!--设置背景色-->
<solid android:color="#68838B" />
<!--设置边线色-->
<stroke
android:width="0.1dp"
android:color="#68838B"/>
<!--设置圆角度数-->
<corners
android:bottomLeftRadius="8dp"
android:bottomRightRadius="8dp"
android:topLeftRadius="8dp"
android:topRightRadius="8dp"/>
</shape>


在使用时,不论是Button还是EditText还是等等等,只要设置

android:background = "@drawable/xxxxx"


就可以了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: