Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/android-studio/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android studio 文本赢得';无法在简单的android应用程序中显示_Android Studio - Fatal编程技术网

Android studio 文本赢得';无法在简单的android应用程序中显示

Android studio 文本赢得';无法在简单的android应用程序中显示,android-studio,Android Studio,所以我在教自己用Android开发。使用下面我从网上下载的非常简单的代码。我想我会从那里开始建造。无论如何,文本显示在AndroidStudio的“设计”预览中。但在模拟器和我的物理平板电脑中,文本不会显示 颜色值(前和背景)显示正确。有人能告诉我我错过了什么吗?如果它是一个明显的东西,它现在不会显示在模拟器中吗 谢谢 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schem

所以我在教自己用Android开发。使用下面我从网上下载的非常简单的代码。我想我会从那里开始建造。无论如何,文本显示在AndroidStudio的“设计”预览中。但在模拟器和我的物理平板电脑中,文本不会显示

颜色值(前和背景)显示正确。有人能告诉我我错过了什么吗?如果它是一个明显的东西,它现在不会显示在模拟器中吗

谢谢

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:weightSum="1">
    <TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="Two buttons"
        android:padding="10dp"
        android:textColor="#FFFFFF"
        android:background="#000000"
        android:autoText="false"
        android:allowUndo="false"
        android:layout_weight=".35" />
    <Button
        android:id="@+id/buttonStart"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="Start"/>
    <Button
        android:id="@+id/buttonStop"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="Stop"/>
</LinearLayout>


看起来还可以。您是否通过调用setContentView(R.layout.***)在活动中加载布局?

是的。正如我所说,它在AndroidStudio的“设计预览”中表现得非常出色。但是在模拟器和物理设备上,文本上没有显示。