为什么我看不到android按钮文字?

时间:2014-01-06 22:11:04

标签: android xml android-layout

在图形布局中,我看到一个按钮,但按钮上没有文字。 我没有看到图形布局中的按钮文本,但在模拟器中我确实看到了它。不知道最近发生了什么。

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity" >

    <TextView
        android:id="@+id/tvCurrentUsername"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:textColor="@color/black" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent" >

        <Button
            android:id="@+id/logout"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginBottom="59dp"
            android:layout_weight="0.23"
            android:text="@string/logOut"
            android:textColor="@color/black"
            android:textSize="20sp" />
    </LinearLayout>

</RelativeLayout>

2 个答案:

答案 0 :(得分:0)

正如其他人所说,不知道会发生什么,但如果它在模拟器上显示你就可以了

答案 1 :(得分:0)

确保您的AndroidManifest.xml与布局xml图形试验更改不会发生冲突。我的Android说App主题,但我使用他们的图形布局生成代码文本,他们冲突...所以有一天我没有看到任何东西。还存在跨平台差异,许多代码需要更高的api版本,因此它们也不会混合。这些可能在理论上是正确的,但会阻止它的轨道。是的,重建。