欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  移动技术

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

程序员文章站 2023-10-19 13:50:25
1.在drawable文件夹下面创建setbar_bg.xml复制代码 代码如下:&...
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"