组件圆角效果设置

在 new 一个 res/drawable/bg_corners.xml

<?xml version="1.0" encoding="utf-8"?>
 
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" android:padding="10dp">

<solid android:color="#80000000" />  线性布局内部为半透明

<stroke android:width="2px" android:color="#cbcbcb" />  线条边框颜色

<corners android:topLeftRadius="25dip" android:topRightRadius="25dip"
    android:bottomRightRadius="25dip" android:bottomLeftRadius="25dip" />  各个边角的弯曲弧度
</shape>

在组件里的background属性设置:

如果线性布局当中使用它, 就可以将线性布局的边角变为圆角了,单个组件的话,就会单个组件是圆角:

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_weight="4"
            android:orientation="vertical"
            android:visibility="visible"            
            android:background="@drawable/bg_corners"
            >




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值