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 –