Android圆角矩形
1.在drawable中创建shape_round文件
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 设置透明背景色 -->
<solid android:color="#ffffffff" />
<!-- 设置一个蓝边框 -->
<stroke android:width="1dp" android:color="#ff1296db" />
<corners android:topLeftRadius="2dp"
android:topRightRadius="2dp"
android:bottomRightRadius="2dp"
android:bottomLeftRadius="2dp"/>
<!-- 设置四个圆角的半径 -->
<corners
android:bottomLeftRadius="20px"
android:bottomRightRadius="20px"
android:topLeftRadius="20px"
android:topRightRadius="20px" />
<!-- 设置一下边距,让空间大一点 -->
<padding
android:bottom="10dp"
android:left="10dp"
android:right="10dp"
android:top="10dp" />
</shape>
2、使用样式
<TextView android:id="@+id/textview" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/shape_round_press_false"/>
---------------------
作者:如果你也听说-小烨
来源:CSDN
原文:https://blog.csdn.net/yangye608/article/details/74910095
版权声明:本文为博主原创文章,转载请附上博文链接!
本博客是个人工作中记录,更深层次的问题可以提供有偿技术支持。
另外建了几个QQ技术群:
2、全栈技术群:616945527
2、硬件嵌入式开发: 75764412
3、Go语言交流群:9924600
闲置域名WWW.EXAI.CN (超级人工智能)出售。
另外建了几个QQ技术群:
2、全栈技术群:616945527
2、硬件嵌入式开发: 75764412
3、Go语言交流群:9924600
闲置域名WWW.EXAI.CN (超级人工智能)出售。

浙公网安备 33010602011771号