2012-09-02 18 views
0

我是在youtube上開發的新波士頓android應用開發的第36個教程。他讓我們複製並粘貼我們的代碼(因爲我們現在應該知道如何去做)。我複製並粘貼它,沒有工作,所以我試着打字。仍然沒有工作。我的R.id沒有工作。之前我已經遇到過這個問題,所以我知道要檢查我的XML文件。在那裏一切都很瘋狂。我遇到了一個錯誤,我有android:layout_width =「match_parent」。做了一些研究,我想更新爲「fill_parent」改變了這一點,現在我在我的XML中出現錯誤,說「錯誤:錯誤parising XML:沒有良好形成(無效令牌)」。我嘗試了多次開始。清潔工程。重新啓動。三重檢查我的代碼。我不知道我做錯了什麼。請幫助傢伙!我瘋了!先謝謝了。Android開發新波士頓*電子郵件*

<?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> 
+0

還你'fill_parent'和'match_parent'倒退。 'fill_parent'不贊成'match_parent',儘管實際上它甚至不重要,因爲常量是相同的。 :/ – kcoppock

回答

2

你在6號線年底錯過了>

變化

android:weightSum="100" 

android:weightSum="100"> 
+0

和'android:id =「etThings」'是錯誤的。應該是'android:id =「@ +/etThings'但是當我放置了'>'時,我能夠輕鬆地調試其餘部分,非常感謝! –