Android 安卓应用程序——我的文本视图文本不是';t显示在应用程序中,但显示在设计视图中

Android 安卓应用程序——我的文本视图文本不是';t显示在应用程序中,但显示在设计视图中,android,Android,在以下代码中,文本框上方的“用户”和“通过”文本未显示: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="f

在以下代码中,文本框上方的“用户”和“通过”文本未显示:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="vertical"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:background="#ffffff">
    <ImageView android:layout_height="wrap_content" android:layout_width="wrap_content" android:src="@drawable/login" android:id="@+id/imageView1" android:layout_alignParentTop="true" android:layout_centerHorizontal="true"></ImageView>
        <TextView android:textAppearance="?android:attr/textAppearanceMedium" android:id="@+id/textView1" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="User:" android:layout_below="@+id/imageView1" android:layout_alignLeft="@+id/editText1" android:layout_marginTop="16dp"></TextView>
        <EditText android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/editText1" android:layout_below="@+id/textView1" android:layout_alignRight="@+id/imageView1" android:layout_alignLeft="@+id/imageView1"></EditText>
        <TextView android:textAppearance="?android:attr/textAppearanceMedium" android:id="@+id/textView2" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="Pass:" android:layout_below="@+id/editText1" android:layout_alignLeft="@+id/editText2"></TextView>
        <EditText android:inputType="textPassword" android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/editText2" android:layout_below="@+id/textView2" android:layout_alignLeft="@+id/editText1" android:layout_alignRight="@+id/editText1"></EditText>
        <Button android:text="Enter" android:id="@+id/button1" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_below="@+id/editText2" android:layout_alignLeft="@+id/editText2" android:layout_marginTop="19dp" android:layout_alignRight="@+id/editText2"></Button>
</RelativeLayout>


抱歉,这有点大,有点长,但我已经搜索了这个问题,并试图找到解决方案,但不能很好地应用到这个问题上。我做错了什么?有人能指导我如何解决这个问题吗?谢谢

我想可能是你的外部相对论背景是白色的(#ffffff),默认情况下(如果我错了请纠正我)Android中的文本是白色的,背景是黑色的。试着和你的朋友鬼混。要快速修复问题,请尝试在您的文本视图或类似内容上设置android:textColor=“#000000”

我看不出有什么问题,你能把你的布局的完整XML发布出来吗。这似乎只是一个没有周围布局的片段。可能少了些什么。也许重新格式化一下XML,水平滚动和长行很难阅读。我已经添加了周围的XML——根据我所做的搜索,我认为它/可能/与相对布局有关?只是在测试这个问题,我可以确认这一点。当您在文本上设置黑色时,文本将显示。如果像这里一样堆叠视图,您也可以在android:orientation=“vertical”中使用LinearLayout。这应该更容易,需要更少的代码。我可以不使用相对布局,因为它提供了更好、更动态的界面。你当然可以,但在这种情况下,它没有任何区别。你可以用两种布局来归档这个外观,但你不必一直在下面写android:layout_=“…”,因为这是一种线性布局的性质,可以将下面的视图相互对齐。很抱歉我的反应太晚-不,即使我将颜色设置为黑色,它也不起作用。