Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/15.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
来自main.xml的android错误消息_Android_Xml - Fatal编程技术网

来自main.xml的android错误消息

来自main.xml的android错误消息,android,xml,Android,Xml,我正在学习一个android教程,它告诉我将此代码添加到main.xml文件中 <TextView android:layout_width="fill_parent" android:layout_height=height="wrap_content" android:text="This is my first Android Application"/> <Button android:layout_width="fil

我正在学习一个android教程,它告诉我将此代码添加到main.xml文件中

    <TextView 
    android:layout_width="fill_parent"
    android:layout_height=height="wrap_content"
    android:text="This is my first Android Application"/>
    <Button
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="And this is a clickable button!/>

这是错误的:

<TextView 
    android:layout_width="fill_parent"
    android:layout_height=height="wrap_content"
这是错误的:

<TextView 
    android:layout_width="fill_parent"
    android:layout_height=height="wrap_content"

该代码中有许多错误

首先,删除布局\高度中重复的“=高度”:

<TextView 
android:layout_width="fill_parent"
android:layout_height="wrap_content"        
android:text="This is my first Android Application"/>

在你的按钮上,你没有关闭android:text中的引号。见:

<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="And this is a clickable button!"/>

最后,将所有这些放在LinearLayout的结束标记之前:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >

<!-- put stuff here -->

<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello" />

<!-- or here -->

</LinearLayout>

该代码中有许多错误

首先,删除布局\高度中重复的“=高度”:

<TextView 
android:layout_width="fill_parent"
android:layout_height="wrap_content"        
android:text="This is my first Android Application"/>

在你的按钮上,你没有关闭android:text中的引号。见:

<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="And this is a clickable button!"/>

最后,将所有这些放在LinearLayout的结束标记之前:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >

<!-- put stuff here -->

<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello" />

<!-- or here -->

</LinearLayout>

您缺少引号:

android:text="And this is a clickable button!/>
修正:


您缺少引号:

android:text="And this is a clickable button!/>
修正:


这个错误消息意味着什么hh没有指定android.test.InstrumentationTestRunner工具,或者没有在其AndroidManifest.xml中声明使用库android.test.runner这是另一个问题。请另外问一个问题。如果此答案解决了布局问题,请单击灰色勾号(在我的答案的左上角)接受我给出的答案并关闭此问题(勾号将变为绿色)。然后你去问另一个问题。你不应该在同一个话题上问两个问题,作为对另一个答案的回答。顺致敬意,关于你的另一个因重复而被关闭的问题:对不起,我不是决定这个的人。试着发同样的问题,告诉他们你已经看过了,但你仍然有问题。这样,版主会看到你进行了研究,但你仍然无法解决你的问题,从而避免它被关闭,因为它是一个重复的问题。试试看……这个错误消息意味着什么hh没有指定android.test.InstrumentationTestRunner工具,或者没有在其AndroidManifest.xml中声明使用库android.test.runner这是另一个问题。请另外问一个问题。如果此答案解决了布局问题,请单击灰色勾号(在我的答案的左上角)接受我给出的答案并关闭此问题(勾号将变为绿色)。然后你去问另一个问题。你不应该在同一个话题上问两个问题,作为对另一个答案的回答。顺致敬意,关于你的另一个因重复而被关闭的问题:对不起,我不是决定这个的人。试着发同样的问题,告诉他们你已经看过了,但你仍然有问题。这样,版主会看到你进行了研究,但你仍然无法解决你的问题,从而避免它被关闭,因为它是一个重复的问题。试试看。。。