Android TextView(圓?。┻吙蚝捅尘皩?shí)例詳解
Android TextView 圓弧
效果圖:


布局代碼:
<TextView
android:id="@+id/product_tag"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:singleLine="true"
android:textSize="10sp"
android:textColor="@color/label_orange"
android:layout_marginLeft="10dp"
android:background="@drawable/shape_label_orange"
android:text="標(biāo)簽"/>
樣式代碼:
弧度和背景主要靠background中的.xml文件實(shí)現(xiàn)

1、
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 實(shí)心 -->
<solid android:color="@android:color/white"/>
<!-- 邊框 -->
<stroke
android:width="0.5dp"
android:color="@color/label_orange"/>
<!-- 圓角 -->
<corners android:radius="3dp"/>
<!-- 邊距 -->
<padding
android:top="2dp"
android:bottom="2dp"
android:left="6dp"
android:right="6dp"/>
</shape>
2、
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval"
android:useLevel="false">
<!-- 實(shí)心 -->
<solid android:color="@color/label_round_orange" />
<!-- 圓角 -->
<corners android:radius="360dp" />
<!-- 邊距 -->
<padding
android:bottom="1dp"
android:left="1dp"
android:right="1dp"
android:top="1dp" />
<!-- 大小 -->
<size android:width="15dp"
android:height="15dp" />
</shape>
感謝閱讀,希望能幫助到大家,謝謝大家對本站的支持!
- Android自定義圓弧進(jìn)度條加數(shù)字動(dòng)態(tài)變化
- Android自定義View繪制彩色圓弧
- Android 自定義球型水波紋帶圓弧進(jìn)度效果(實(shí)例代碼)
- 一個(gè)簡單的Android圓弧刷新動(dòng)畫
- Android自定義View實(shí)現(xiàn)圓弧進(jìn)度效果
- 利用Android畫圓弧canvas.drawArc()實(shí)例詳解
- Android 自定View實(shí)現(xiàn)仿QQ運(yùn)動(dòng)步數(shù)圓弧及動(dòng)畫效果
- Android實(shí)現(xiàn)漸變色的圓弧虛線效果
- Android使用ImageView 制作透明圓弧實(shí)例代碼
- android實(shí)現(xiàn)簡單圓弧效果
相關(guān)文章
Android中的RecyclerView新組件初步上手指南
RecyclerView是Android L版本開始采用的一個(gè)組件,被人們認(rèn)為用來代替?zhèn)鹘y(tǒng)的ListView,下面我們就一起來看一下Android中的RecyclerView新組件初步上手指南2016-06-06
android popuwindow點(diǎn)擊外部窗口不消失的實(shí)例
下面小編就為大家?guī)硪黄猘ndroid popuwindow點(diǎn)擊外部窗口不消失的實(shí)例。小編覺得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧2017-04-04
非常實(shí)用的小功能 Android應(yīng)用版本的更新實(shí)例
這篇文章主要為大家詳細(xì)介紹了一個(gè)非常實(shí)用的小功能,Android應(yīng)用版本的更新實(shí)例,感興趣的小伙伴們可以參考一下2016-08-08
Android中Intent傳遞對象的兩種方法Serializable,Parcelable
這篇文章主要介紹了Android中的傳遞有兩個(gè)方法,一個(gè)是Serializable,另一個(gè)是Parcelable,對intent傳遞對象的兩種方法感興趣的朋友一起學(xué)習(xí)吧2016-01-01
淺談Android Service服務(wù)的高級(jí)技巧
這篇文章主要介紹了淺談Android 服務(wù)的高級(jí)技巧,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧2018-07-07
Android開發(fā)Jetpack組件Room用例講解
這篇文章主要為大家介紹了Android?Jetpack組件Room的使用案例的詳細(xì)講解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步2022-02-02
詳解Android獲取系統(tǒng)內(nèi)核版本的方法與實(shí)現(xiàn)代碼
這篇文章主要介紹了詳解Android獲取系統(tǒng)內(nèi)核版本的方法與實(shí)現(xiàn)代碼的相關(guān)資料,這里提供了具體實(shí)現(xiàn)獲取內(nèi)核的方法,需要的朋友可以參考下2017-07-07
Python基礎(chǔ)教程學(xué)習(xí)筆記 第一章 基礎(chǔ)知識(shí)
這篇文章主要介紹了Python基礎(chǔ)教程學(xué)習(xí)筆記 第一章 基礎(chǔ)知識(shí) ,需要的朋友可以參考下2015-03-03

