现在的位置: 首页 > 综合 > 正文

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

2013年04月12日 ⁄ 综合 ⁄ 共 317字 ⁄ 字号 评论关闭

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"

抱歉!评论已关闭.