我想在屏幕的底部放置一個TableRow,在佈局的其他視圖元素下放置兩個按鈕,但是如果放到那裏,TableRow消失的屏幕。我把我放在頂部或中間,沒問題。使用TableLayout在屏幕底部的位置視圖
我正在嘗試很多layout_gravity,重力和重量組合,但我無法得到它。
在此先感謝。
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:gravity="center_horizontal"
android:text="@string/traza"
android:layout_margin="10sp"/>
<TableRow
android:id="@+id/tableRow8"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="3sp"
android:gravity="center"
android:weightSum="2" >
<Button
android:id="@+id/reiniciar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_margin="5sp"
android:background="@drawable/bordebutton"
android:text="@string/reiniciar" />
<Button
android:id="@+id/comprobar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_margin="5sp"
android:background="@drawable/bordebutton"
android:text="@string/comprobar" />
</TableRow>
<android.gesture.GestureOverlayView
android:id="@+id/gestures"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fadeEnabled="true"
android:fadeOffset="3000"
android:gestureStrokeType="multiple"
android:eventsInterceptionEnabled="true"
android:orientation="vertical"/>
</LinearLayout>
它不起作用,它崩潰:(04-21 17:05:06.363:E/AndroidRuntime(20964):java.lang.RuntimeException:無法啓動活動ComponentInfo {es.hsk.ap/es.hsk.ap .juega.Trazos}:java.lang.ClassCastException:android.gesture.GestureOverlayView – Pelanes 2012-04-21 17:06:28
然後從您的佈局中刪除'android.gesture.GestureOverlayView',清理項目,然後運行它。實際上我沒有添加** GestureOverlayView **到佈局我自己,它已經在你的佈局中提到過,如果它崩潰,那麼你怎麼能夠運行它? – waqaslam 2012-04-21 17:19:48
當我將LineaLayout更改爲RelativeLayout時,它會崩潰,因爲你剛開始時說過,我不能移除這個視圖,我需要它。問題不是這樣,它會發生,如果您在中間使用其他佈局,像imageview – Pelanes 2012-04-23 12:06:03