给Android的LinearLayout加边框分为两种方式,给LinearLayout整体加边框和给某一个边加边框
第一种:给整体加边框
在drawable文件夹中新建shape资源文件,将下列代码粘贴进去:
-
<?xml version="1.0" encoding="utf-8"?>
-
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
-
<solid android:color="#FFFFFF" />
-
<stroke
-
android:width="1dp"
-
android:color="#000000" />
-
<padding
-
android:bottom="0.1dp"