【问题标题】:The best way to create a TextView that looks like this创建看起来像这样的 TextView 的最佳方法
【发布时间】:2021-03-21 04:54:02
【问题描述】:

我正在尝试重新创建这种类型的 TextView。是 Material Design TextInput 还是修改后的 TextView? 如何将线放在 TextView 的顶部? 谢谢。

【问题讨论】:

    标签: android user-interface textview material-design


    【解决方案1】:

    这只是一个带有背景属性的view。像这样使用它:

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="20dp"
        android:orientation="vertical">
    
        <View
            android:layout_width="match_parent"
            android:layout_height="1dp"
            android:background="@color/black"/>
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="View line placed above the text view"
            android:layout_marginTop="5dp"/>
    
    </LinearLayout>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多