• 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
    版权声明:本文为博主原创文章,转载请附上博文链接!

  • 相关阅读:
    Android系统根文件系统目录结构
    4面 晶晨半导体 问题总结
    linux 工作队列
    Linux tasklet 的测试
    ArbotiX-M引脚说明
    locobot
    视频地址
    S1雷达ROS包更新指南
    rospy
    mx-28在 labview环境下的开发
  • 原文地址:https://www.cnblogs.com/zhaogaojian/p/9806850.html
Copyright © 2020-2023  润新知