0
我想創建一個textView
包圍圓形圓圖,如下所示:我想創建一個TextView包圍圓形圓圖如下所示
圖像鏈接: - https://i.stack.imgur.com/E0cMB.png
罐中的任何一個你讓我知道如何做到這一點?
我想創建一個textView
包圍圓形圓圖,如下所示:我想創建一個TextView包圍圓形圓圖如下所示
圖像鏈接: - https://i.stack.imgur.com/E0cMB.png
罐中的任何一個你讓我知道如何做到這一點?
檢查如何實現上述圖片要求。 佈局的數據應該是這樣的:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#004473">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_margin="5dp"
android:background="@drawable/linear_layout_corner_shape"
android:orientation="horizontal">
<TextView
android:layout_width="60dp"
android:layout_height="60dp"
android:gravity="center"
android:text="01"
android:background="@drawable/textview_circle_shape"
android:textSize="20sp"
android:textColor="#000000"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingLeft="15dp"
android:text="Lorum Ipusum"
android:textSize="20sp"
android:textColor="#FFFFFF"/>
</LinearLayout>
</LinearLayout>
繪製對象文件中的數據:
linear_layout_corner_shape.xml
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#004473"></solid>
<stroke
android:width="2dp"
android:color="#FFFFFF"></stroke>
<corners android:radius="30dp"></corners>
textview_circle_shape.xml
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="#FFFFFF"></solid>
注意到可拉伸作爲背景 – Champandorid
最好的方法來創建使用XML視圖。 –
Champandorid我必須設置文本textview在該image.so這就是爲什麼我沒有把它作爲drawable –