Home >Java >javaTutorial >Detailed explanation of how to set the background color and border of Android TextView

Detailed explanation of how to set the background color and border of Android TextView

高洛峰
高洛峰Original
2017-01-20 15:21:221809browse

1. Create setbar_bg.xml under the drawable folder

<?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. Set the TextView order

 android:background="@drawable/setbar_bg"

For more details on how to set the background color and border of Android TextView, please follow PHP. Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn