我有xml
,xml
我在Horizontal Line
之间添加了TextViews
。
我在分隔符中添加Shape
但我看不到更改。
main_activity.xml :
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="20dp"
android:text="HELLO"
android:textColor="@android:color/black" />
<View
android:id="@+id/vVerticalLine"
android:background="@drawable/horizontal_shape"
android:layout_width="match_parent"
android:layout_marginLeft="50dp"
android:layout_marginRight="20dp"
android:layout_below="@+id/title"
android:layout_height="10dp" />
<TextView
android:id="@+id/txt"
android:layout_width="match_parent"
android:layout_height="20dp"
android:text="HELLO"
android:textColor="@android:color/black" />
和我的horizontal_shape.xml
:
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="line">
<corners
android:bottomLeftRadius="5dp"
android:bottomRightRadius="5dp"
android:topLeftRadius="5dp"
android:topRightRadius="5dp" />
<stroke
android:color="#000000" />
</shape>
例如我需要:
答案 0 :(得分:5)
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners
android:bottomLeftRadius="5dp"
android:bottomRightRadius="5dp"
android:topLeftRadius="5dp"
android:topRightRadius="5dp" />
<size
android:height="6dp" />
<solid
android:color="#daa520" />
</shape>