Android TextView設置背景色與邊框的方法詳解
更新時間:2013年06月14日 16:56:54 作者:
本篇文章是對Android中TextView設置背景色與邊框的方法進行了詳細的分析介紹,需要的朋友參考下
1.在drawable文件夾下面創(chuàng)建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"
復制代碼 代碼如下:
<?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"
您可能感興趣的文章:
- android TextView設置中文字體加粗實現方法
- Android編程開發(fā)之TextView文字顯示和修改方法(附TextView屬性介紹)
- Android TextView字體顏色設置方法小結
- android實現上下滾動的TextView
- android TextView多行文本(超過3行)使用ellipsize屬性無效問題的解決方法
- android TextView不用ScrollViewe也可以滾動的方法
- Android設置TextView顯示指定個數字符,超過部分顯示...(省略號)的方法
- Android中TextView顯示圓圈背景或設置圓角的方法
- Android中TextView實現分段顯示不同顏色的字符串
- Android?妙用TextView實現左邊文字,右邊圖片
相關文章
Android中使用IntentService創(chuàng)建后臺服務實例
這篇文章主要介紹了Android中使用IntentService創(chuàng)建后臺服務實例,IntentService提供了在單個后臺線程運行操作的簡單結構,需要的朋友可以參考下2014-06-06
Android環(huán)形進度條(安卓默認形式)實例代碼
這篇文章主要介紹了Android環(huán)形進度條(安卓默認形式)實例代碼的相關資料,需要的朋友可以參考下2016-03-03
Android Studio3.6設置Gradle Offline Mode的方法
這篇文章主要介紹了Android Studio3.6設置Gradle Offline Mode的方法,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧2020-03-03

