【问题标题】:TextView is not visible in Android 5.1.1TextView 在 Android 5.1.1 中不可见
【发布时间】:2016-04-11 00:26:10
【问题描述】:

我有以下 xml:

<RelativeLayout
    android:id="@+id/exerciseNameLayout"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:alpha="1"
    android:clickable="true">

    <Button
        android:id="@+id/exerciseNameButton"
        android:layout_width="match_parent"
        android:layout_height="@dimen/button_height"
        android:background="@drawable/button_no_bottom_border"
        android:text="@string/exercise_name"
        android:textAllCaps="false"
        android:textColor="@color/selected"
        android:textSize="@dimen/button_font_size"
        android:gravity="center_vertical"
        android:paddingLeft="15dp"/>

    <TextView
        android:id="@+id/Label1"
        android:layout_width="100dp"
        android:layout_height="30dp"
        android:layout_alignParentRight="true"
        android:layout_marginRight="20dp"
        android:layout_marginTop="5dp"
        android:text="10 X 10"
        android:paddingRight="10dp"
        android:textColor="@color/unselected"/>

</RelativeLayout>

文本视图在 Android 5.1.1 中不显示,但在 android 版本 中可见

我不知道如何解决这个问题。 我还发现我什至在预览中都看不到它。虽然我可以从预览中选择它,但没有出现文本 10X10。

【问题讨论】:

  • 您尝试更改 textColor 吗?
  • 是的,我确实更改了文本颜色,但没有帮助

标签: android xml textview visibility android-5.1.1-lollipop


【解决方案1】:

将 ADB 连接到您的测试设备并运行 Hierarchy Viewer 以查看 UI 中的内容。您使用的文本颜色可能在 Android 5.1.1 中发生了变化。

【讨论】:

    猜你喜欢
    • 2014-06-25
    • 1970-01-01
    • 2011-02-07
    • 2013-07-06
    • 2020-12-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-11-15
    相关资源
    最近更新 更多