2011-09-02 27 views
0

我正面臨一個奇怪的問題,我無法弄清楚爲什麼我係統地得到應用程序的意外停止,當我嘗試在我的課程的onCreateView中膨脹以下XML文件時擴展Fragment類:與XML文件相關的奇怪錯誤

<?xml version="1.0" encoding="UTF-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="horizontal" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent"  
    android:background="@drawable/fond_application_horizontal"> 

<Button 
    android:id="@+id/ZoomPlusY" 
    android:layout_height="140dip" 
    android:layout_width="40dip" 
    android:text="Y+">    
</Button> 


<Button 
    android:id="@+id/ZoomMoinsY" 
    android:layout_height="140dip" 
    android:layout_width="40dip" 
    android:layout_below="@id/ZoomPlusY" 
    android:text="Y-">    
</Button> 

<Button 
    android:id="@+id/ZoomOptimum" 
    android.layout.width="70dip" 
    android.layout.height="40dip" 
    android:layout_below="@id/ZoomMoinsY" 
    android:text="Opt"> 
</Button> 

</RelativeLayout> 

如果我壓抑的第三個按鈕,XML文件是完全膨脹和應用程序不會崩潰。

有什麼想法?

在此先感謝您花費時間來幫助我。

+0

日誌顯示什麼? –

回答

0

你或許應該包括你的logcat的追蹤,但立即在看着你的佈局我看到至少有一個問題:

android.layout.width="70dip" 
android.layout.height="40dip" 

這些屬性的名稱應該是android:layout_heightandroid:layout_width

另外,android:orientationRelativeLayout上沒有意義。

+0

你已經找到了錯誤。好像是時候讓我買一副眼鏡了...... – Zelig

0

爲什麼在第三個按鈕android.layout.width中使用dot syntax?這是一個複製錯誤,或者這是你的XML realy的樣子?