android中如何给button加圆角
来源:互联网 发布:极限挑战知乎话题 编辑:程序博客网 时间:2024/06/05 14:03
- //round_corner_bg.xml
- <?xml version="1.0" encoding="UTF-8"?>
- <shape xmlns:android="http://schemas.android.com/apk/res/android"
- android:shape="rectangle" >
- <!-- 填充的颜色 -->
- <solid android:color="#ff000000" />
- <!-- 设置矩形的四个角为弧形 -->
- <!-- android:radius 弧形的半径 -->
- <corners android:radius="7dip" />
- </shape>
或
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
shape
xmlns:android
=
"http://schemas.android.com/apk/res/android"
>
<
solid
android:color
=
"#FFFFFF"
/>
<
corners
android:topLeftRadius
=
"10dp"
android:topRightRadius
=
"10dp"
android:bottomRightRadius
=
"10dp"
android:bottomLeftRadius
=
"10dp"
/>
</
shape
>
layout中给button加上background属性
android:background="@drawable/round_corner_bg"
上述方法也适用于其他控件
0 0
- android中如何给button加圆角
- android中如何给button加圆角
- android中如何给button加圆角
- Android 给Button加圆角
- Android如何给Button添加圆角
- 如何给button加超链
- Android给Button设置drawableRigh 在代码中动态改变
- 给BUtton加圆角
- android中如何实现button 不同状态显示切换背景图
- android 中button上如何显示图片和文字
- 在android中如何让button禁止使用
- android中如何设置点击button页面跳转
- Android xml布局中Button英文默认大写,如何小写?
- 如何给button添加上图标 .
- MVVM如何给BUTTON按钮注册事件
- Android 如何给Button上面的文字设置点击后变颜色
- android中Button控件
- Android中点击Button
- android测试之三:monkeyRunner
- Mongo解决注册码到期的问题
- 阿里云服务器相关
- OpenGL ES入门详解
- Swift中如何在一行中定义多个变量
- android中如何给button加圆角
- CI支持AJAX分页
- 错误与“错误”
- Unity3D深入浅出 - 新版动画系统(Mecanim)
- Codeforces 600B Queries about less or equal elements 【离散化去重二分查找 + 树状数组】
- PostgreSQL SQL SELECT CASE WHEN
- 中小型网站架构分析及优化
- (解题报告)HDU2001---计算两点间的距离
- block