本文主要是介绍Andriod 给控件添加边框,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
1、矩形边框:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="match_parent"android:layout_height="match_parent"android:shape="rectangle"><stroke
android:width="1dp"android:color="#ebebeb"/><padding
android:bottom="1dp"android:left="1dp"android:right="1dp"android:top="1dp"/><solid android:color="#00000000"/></shape>
2、圆角边框
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="match_parent" android:layout_height="match_parent"><!-- 填充颜色 --><solid android:color="#FFFFFF"></solid><!-- 线的宽度,颜色灰色 --><stroke android:width="1dp" android:color="#33CCFF"></stroke><!-- 矩形的圆角半径 --><corners android:radius="5dp" /></shape>
这篇关于Andriod 给控件添加边框的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!