按钮显示不正常



我想在页面底部显示一些按钮,我的按钮是图像和文本,然后我在XML中使用按钮标签。我有 4 张按钮图片(PNG 图片)。我写了这个XML,但我的按钮没有一起显示,也没有站在页面底部,这些按钮显示一点,页面更高,相距很远。

XML 文件:

 <?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/linearLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:background="@color/white">
<TextView
    android:id="@+id/logoText"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:background="@color/dark_blue"
    android:textColor="@color/blue_text"
    android:textSize="20sp"
    android:paddingRight="3dp"/>
<FrameLayout
    android:id="@+id/frameLayout"
    android:layout_width="fill_parent"
    android:layout_height="0dp"
    android:layout_weight="1.0"/>
<LinearLayout
    android:id="@+id/linearLayout2"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal"
    android:layout_weight="0">
    <Button
        android:id="@+id/btn1"
        android:layout_marginRight="-10dp"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:drawableTop="@drawable/image"
        android:soundEffectsEnabled="true"
        android:background="@null"/>
    <Button
        android:id="@+id/btn2"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:drawableTop="@drawable/b2"
        android:soundEffectsEnabled="true"
        android:background="@null"/>
    <Button 
        android:id="@+id/btn3"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:drawableTop="@drawable/b3"
        android:soundEffectsEnabled="true"
        android:background="@null"/>
    <Button 
        android:id="@+id/btn4"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:drawableTop="@drawable/b4"
        android:soundEffectsEnabled="true"
        android:background="@null"/>
    </LinearLayout>
    </LinearLayout>

对不起,我的英语很差,谢谢你的建议。

谢谢,干杯。

删除下面的"layout_weight="0",然后重试

<LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_weight="0">

最新更新