1

私は底に3つのボタンバットを持っています。エミュレーターでテストすると、フルスクリーンが表示されます。デバイスでテストすると、下のボタンが表示されません。解像度が間違っているようです。ここに私のxmlレイアウトがあります:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@raw/mexicanbg"
android:orientation="vertical" >




<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >

    <Button
        android:id="@+id/buttonbacksubreclist"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="15dp"
        android:background="@drawable/back_button"
        android:onClick="back" />

    <TextView
        android:id="@+id/textViewreclist"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_marginLeft="45dp"
        android:text="@string/reclist"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:textColor="#000000" />

 </LinearLayout>


 <LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >
 </LinearLayout>

 <ListView
    android:id="@+id/android:list"
    android:layout_width="fill_parent"
    android:layout_height="382dp" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="362dp" >

<Button
    android:id="@+id/buttonRecipes"
    android:layout_width="108dp"
    android:layout_height="wrap_content"
    android:background="@drawable/menu_xrecipes"
    android:onClick="recipe"
    android:text="@string/rec" />

<Button
    android:id="@+id/buttonGroList"
    android:layout_width="110dp"
    android:layout_height="wrap_content"
    android:background="@drawable/menu_xgrocery"
    android:onClick="grocerylist"
    android:text="@string/grolist" />

<Button
    android:id="@+id/button1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/menu_xmore"
    android:text="@string/more" />
</LinearLayout>

</LinearLayout>

編集: 新しいレイアウト:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@raw/mexicanbg"
android:orientation="vertical" >




<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >

    <Button
        android:id="@+id/buttonbacksubreclist"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="15dp"
        android:background="@drawable/back_button"
        android:onClick="back" />

    <TextView
        android:id="@+id/textViewreclist"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_marginLeft="45dp"
        android:text="@string/reclist"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:textColor="#000000" />

</LinearLayout>

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >
</LinearLayout>


<ListView
    android:id="@+id/android:list"
    android:layout_width="fill_parent"
    android:layout_height="382dp" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="362dp" >




<Button
    android:id="@+id/buttonRecipes"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_weight="1"
    android:background="@drawable/menu_xrecipes"
    android:onClick="recipe"
    android:text="@string/rec" />



<Button
    android:id="@+id/buttonGroList"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_weight="1"
    android:background="@drawable/menu_xgrocery"
    android:onClick="grocerylist"
    android:text="@string/grolist" />



<Button
    android:id="@+id/button1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_weight="1"
    android:background="@drawable/menu_xmore"
    android:text="@string/more" />

</LinearLayout>

</LinearLayout>
4

4 に答える 4

1

これを試して:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@raw/mexicanbg"
    android:orientation="vertical" >

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >

        <Button
            android:id="@+id/buttonbacksubreclist"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="15dp"
            android:background="@drawable/back_button"
            android:onClick="back" />

        <TextView
            android:id="@+id/textViewreclist"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_marginLeft="45dp"
            android:text="@string/reclist"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:textColor="#000000" />
    </RelativeLayout>

    <RelativeLayout
        android:id="@+id/real1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >

        <ListView
            android:id="@+id/android:list"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:scrollX="true" />
    </RelativeLayout>

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_below="@+id/real1" >

        <Button
            android:id="@+id/buttonRecipes"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:background="@drawable/menu_xrecipes"
            android:onClick="recipe"
            android:text="@string/rec" />

        <Button
            android:id="@+id/buttonGroList"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:background="@drawable/menu_xgrocery"
            android:onClick="grocerylist"
            android:text="@string/grolist" />

        <Button
            android:id="@+id/button1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:background="@drawable/menu_xmore"
            android:text="@string/more" />
    </RelativeLayout>

</RelativeLayout>
于 2012-09-20T11:10:40.680 に答える
0

私は答えを見つけました...問題はボタンではありません..それは私のListViewにあります。私は自分のリストビューに重きを置いていませんでした。これが私の最終的なxmlレイアウトです:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@raw/mexicanbg">






   <LinearLayout
   android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true"
        android:layout_width="fill_parent"
        android:layout_height="50dip"
        android:orientation="horizontal"
        android:background="@drawable/xpage_label">




    <TextView
        android:id="@+id/textViewrecipe"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_margin="10dp"
        android:layout_marginBottom="10dp"
        android:text="@string/rec"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:textColor="#000000" />

 </LinearLayout>








 <ListView
    android:id="@+id/android:list"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_weight="1" />

 <LinearLayout
     android:layout_width="match_parent"
     android:layout_height="wrap_content" >

     <Button
         android:id="@+id/button3"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_weight="1"
         android:background="@drawable/menu_xrecipes"
         android:onClick="recipe" />

     <Button
         android:id="@+id/buttonGroList"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_weight="1"
         android:background="@drawable/menu_xgrocery"
         android:onClick="grocerylist" />

     <Button
         android:id="@+id/button1"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_weight="1"
         android:background="@drawable/menu_xmore" />
 </LinearLayout>

</LinearLayout>
于 2012-09-20T11:32:44.623 に答える
0

これを試して :

  <?xml version="1.0" encoding="utf-8"?>
   <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
     android:background="@raw/mexicanbg"
      android:orientation="vertical" >

 <LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >

<Button
    android:id="@+id/buttonbacksubreclist"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginLeft="15dp"
    android:background="@drawable/back_button"
    android:onClick="back" />

<TextView
    android:id="@+id/textViewreclist"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    android:layout_marginLeft="45dp"
    android:text="@string/reclist"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:textColor="#000000" />

   </LinearLayout>

   <LinearLayout
android:layout_width="match_parent"
android:layout_height="200dp" >



  <ListView
android:id="@+id/android:list"
android:layout_width="fill_parent"
android:layout_height="200dp" />
 </LinearLayout>

 <LinearLayout
 android:layout_width="match_parent"
 android:layout_height="wrap_content" >




<Button
android:id="@+id/buttonRecipes"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/menu_xrecipes"
android:onClick="recipe"
android:text="@string/rec" />



<Button
android:id="@+id/buttonGroList"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/menu_xgrocery"
android:onClick="grocerylist"
android:text="@string/grolist" />



<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/menu_xmore"
android:text="@string/more" />

 </LinearLayout>

   </LinearLayout>
于 2012-09-20T11:25:00.643 に答える
0

最後の線形レイアウトを相対レイアウトに置き換えandroid:layout_alignParentBottom="true" 、RelativeLayout をルート レイアウトとして指定して作成します。

于 2012-09-20T11:03:42.207 に答える