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

高洛峰
Release: 2017-01-20 15:21:22
Original
1824 people have browsed it

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>
Copy after login

2. Set the TextView order

 android:background="@drawable/setbar_bg"
Copy after login

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template