我有一个 xml
文件,其中我在 TextViews
之间添加了一条 Horizontal Line
。我为分隔符添加了一个 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>
例如,我需要:
例如,您可以使用以下代码将文本框添加到 HTML 中:
``` ```
该代码将创建一个名为“myText”的文本输入框,用户可以在其中输入文本。