2011-07-03 10 views
0
'<?xml version="1.0" encoding="utf-8"?> 
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
android:background="@drawable/droid_background"> 
<TextView 
android:layout_height="wrap_content" 
android:gravity="center_horizontal" 
android:text="@string/hello" 
android:textColor="#FFFFFF" 
android:textStyle="bold"/> 

<RelativeLayout 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" /> 
<Button 
android:drawable="@drawable/toggleSelection" 
android:layout_alignBottom="true" 
android:layout_alignParentLeft="true" /> 
</RelativeLayout> 
</TableLayout>' 

これについてよく整形されていないものは何ですか?すべての要素が終了します。右?Android XMLはうまく構成されていませんか?

答えて

3

RelativeLayoutは2回クローズされます。

<RelativeLayout 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" /> <!-- here --> 
<Button 
android:drawable="@drawable/toggleSelection" 
android:layout_alignBottom="true" 
android:layout_alignParentLeft="true" /> 
</RelativeLayout>       <!-- and here again --> 
+0

今ではボタンがうまく形成されないものではなく、RelativeLayoutが続かなければなりませんと言います>または/> – Cataroux

+1

@Cataroux XMLファイルの新しいバージョンを表示します。 – phlogratos

1

完全なXMLファイルには、次のようになります(RelativeLayoutの閉じ括弧で/を削除)

<?xml version="1.0" encoding="utf-8"?> 
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
android:background="@drawable/droid_background"> 
<TextView 
android:layout_height="wrap_content" 
android:gravity="center_horizontal" 
android:text="@string/hello" 
android:textColor="#FFFFFF" 
android:textStyle="bold"/> 
<RelativeLayout 
android:layout_width="fill_parent" 
android:layout_height="fill_parent"> 
<Button 
android:drawable="@drawable/toggleSelection" 
android:layout_alignBottom="true" 
android:layout_alignParentLeft="true" /> 
</RelativeLayout> 
</TableLayout> 
関連する問題