Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/208.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
android文本视图,文本后带行_Android_Textview - Fatal编程技术网

android文本视图,文本后带行

android文本视图,文本后带行,android,textview,Android,Textview,如何实现示例中的一件事情 文本视图,文本后有一行 用于添加行检查 并将此视图与文本视图的右侧对齐。 完成了试试这个方法这对我很有效 <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <TextView android:layout_width=

如何实现示例中的一件事情 文本视图,文本后有一行

用于添加行检查

并将此视图与文本视图的右侧对齐。
完成了

试试这个方法这对我很有效

 <LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal">

   <TextView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_marginTop="3dp"
      android:text="Heelloos"
      android:layout_marginLeft="10dp"/>

   <View
      android:layout_width="150dp"
      android:layout_height="1dp"
      android:layout_gravity="bottom"
      android:background="#ff00ff"/>

 </LinearLayout>

输出

尝试以下答案:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <TextView
        android:id="@+id/textView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:gravity="center_horizontal"
        android:text="Your Message: "
        android:textAppearance="?android:attr/textAppearanceLarge" />

    <View
        android:layout_width="150dp"
        android:layout_height="1dp"
        android:layout_alignBottom="@+id/textView"
        android:layout_gravity="bottom"
        android:layout_toEndOf="@+id/textView"
        android:layout_toRightOf="@+id/textView"
        android:background="#FF0000FF" />

</RelativeLayout>

该行的用途是什么?是否用于用户输入?