android - 添加圆角边框

访问量: 119

参考: https://stackoverflow.com/questions/16161448/how-to-make-layout-with-rounded-corners

1. 在 res/drawable 目录下,添加这个xml 文件:

<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <solid android:color="#f8f8f8"/>
    <corners android:radius="13dp"/>
    <padding android:left="0dip" android:top="0dip" android:right="0dip" android:bottom="0dip" />
</shape>

2. 在对应的xml中包含它即可:

android:background="@drawable/rounded_border"

订阅/RSS Feed

Subscribe

分类/category