Android TextView设置背景色与边框的方法详解


1.在drawable文件夹下面创建setbar_bg.xml
复制代码 代码如下:

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
    <!-- 背景色 -->
    <solid android:color="#FFE4B5"/>
    <!-- 边框色 -->
    <stroke android:width="0.5dip" android:color="#81CE47" />
</shape>

2.设置TextView顺序
复制代码 代码如下:

 android:background="@drawable/setbar_bg"


« 
» 
快速导航

Copyright © 2016 phpStudy | 豫ICP备2021030365号-3