2016-01-06 78 views
0

我有以下XML:TextView中是不可见的安卓5.1.1

<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> 

TextView的不显示在Android 5.1.1,但它的Android版本是可见< 5.0

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

+0

您试图更改textColor? – seba123neo

+0

是的,我确实改变了文字颜色,但没有帮助 –

回答

1

将ADB连接到您的测试设备并运行Hierarchy Viewer以查看界面中的内容。在Android 5.1.1中,您使用的文字颜色可能已更改。