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

来源:互联网 发布:查看软件版本 编辑:程序博客网 时间:2024/06/01 07:25

在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"

就可以了。

0 0
原创粉丝点击