Android 开发:(四)Button圆角实现
来源:互联网 发布:家用配电箱品牌知乎 编辑:程序博客网 时间:2024/06/02 06:31
本节学习button的圆角实现:
利用上节登录button示例:
1.效果对比:
<Button android:layout_width="match_parent" android:layout_height="45dp" android:layout_marginTop="10dp" android:layout_below="@id/rg" android:id="@+id/loginBtn" android:text="登录" (1)、没有圆角设置 android:background="#ff0000" (2)、设置圆角 android:background="@drawable/shape" android:textSize="19sp" android:textColor="#ffffff" />
2.具体实现步骤:
代码:
<!-- 填充的颜色 --> <solid android:color="#ff0000" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <!-- 设置按钮的四个角为弧形 --> <!-- android:radius 弧形的半径 --> <corners android:radius="5dp" android:layout_height="match_parent" android:layout_width="wrap_content" /> <!-- padding:Button里面的文字与Button边界的间隔 --> <padding android:bottom="10dp" android:left="10dp" android:right="10dp" android:top="10dp" android:layout_width="wrap_content" android:layout_height="wrap_content" />
最后给button赋值即可:
android:background="@drawable/shape"
1 0
- Android 开发:(四)Button圆角实现
- Android开发圆角button的简单实现
- Android开发笔记:圆角的Button
- android 利用代码实现圆角button(shape)
- android实现的圆角按钮Button
- Android笔记:实现圆角的Button
- 【Android】圆角边框Button的实现
- android开发 button的实现方法(OnClickListener)
- Android 开发 圆角 Button 按钮 xml 实现
- Android开发--圆角 Button 按钮 xml 实现
- android 开发button按下有震动怎样实现
- 零基础ios开发(四 用继承BUTTON的方法 实现打地鼠)
- Android学习(四)使用Button
- Android开发之四(十三):常用控件之按钮(Button)
- [Android学UI之四]实现分断Button,模仿MIUI设置页面顶部Button
- Android开发学习笔记:圆角的Button
- Android开发学习笔记:圆角的Button
- Android开发学习笔记:圆角的Button
- bzoj1876: [SDOI2009]SuperGCD
- Ubuntu安装jdk
- springboot 中@ConfigurationProperties和@importResource的作用和区别
- hibernate配置文件
- 关于从服务器获取的JSON数据为OC关键字的解决方法(id, description)
- Android 开发:(四)Button圆角实现
- Java学习笔记--线程
- 工作学习中的错误
- React Native基础与入门(二)--初识React Native
- MVP-架构
- Lamp兄弟连Linux视频教程
- CS107-Lecture 3-Note
- jquery组件WebUploader文件上传用法详解
- 单例设计模式的分析(懒汉,饿汉式)