Java Android开发新boston*电子邮件*
我正在youtube上学习第36期Newboston android应用程序开发教程。他让我们复制并粘贴代码(因为我们现在应该知道怎么做了)。我复制粘贴了它,但不起作用,所以我试着把它全部打印出来。还是不行。我的身份证坏了。我以前已经遇到过这个问题,所以我知道要检查我的XML文件。那里的一切都很疯狂。我在android的任何地方都会遇到一个错误:layout\u width=“match\u parent”。做了一些研究,我猜更新为“fill_parent”改变了这一点,现在我在XML中得到一个错误,说“error:error parising XML:not well format(invalid token)”。我试过多次重新开始。清洁项目。重新启动。三重检查我的代码。我不知道我做错了什么。请帮帮我!我快发疯了!!提前谢谢Java Android开发新boston*电子邮件*,java,android,Java,Android,我正在youtube上学习第36期Newboston android应用程序开发教程。他让我们复制并粘贴代码(因为我们现在应该知道怎么做了)。我复制粘贴了它,但不起作用,所以我试着把它全部打印出来。还是不行。我的身份证坏了。我以前已经遇到过这个问题,所以我知道要检查我的XML文件。那里的一切都很疯狂。我在android的任何地方都会遇到一个错误:layout\u width=“match\u parent”。做了一些研究,我猜更新为“fill_parent”改变了这一点,现在我在XML中得到一个
<?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="100"
<ScrollView
android:layout_weight="30"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:text="Email address(es):"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<EditText
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:id="@+id/etEmails"
/>
<TextView
android:text="Hatfull intro"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<EditText
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:id="@+id/etIntro"
/>
<TextView
android:text="Persons name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/etName"
/>
<TextView
android:text="Stupid things this person does:"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<EditText
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:id="etThings"
/>
<TextView
android:text="What do you want to do to this person?"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<EditText
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:id="@+id/etAction"
/>
<TextView
android:text="Hatefull Outro"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/etOutro"
/>
</LinearLayout>
</ScrollView>
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="40">
<Button
android:text="Send"
android:id="@+id/bSentEmail"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
</Button>
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="30">
<AnalogClock
android:id="@+id/analogClock1"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
</AnalogClock>
</LinearLayout>
</LinearLayout>
您错过了第6行末尾的
:
改变
android:weightSum="100"
到
此外,您还有fill\u parent
和match\u parent
向后fill\u parent
被弃用,取而代之的是match\u parent
,尽管实际上这并不重要,因为常数是相同的:/android:id=“etThings”
是错误的。本来应该是android:id=“@+/etThings
,但是当我放置
后,我可以轻松调试其余的。非常感谢!
android:weightSum="100">