【发布时间】:2024-04-29 12:10:04
【问题描述】:
我知道有这样的问题,但大多数时候他们的问题似乎是他们没有将布局对齐为填充父级。好吧,我这样做了,我不确定为什么我的按钮仍然无法做到。可能是因为我使用的所有布局?
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/face">
<RelativeLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="100dp" android:gravity="center">
<ImageView android:layout_marginLeft="15dp" android:layout_marginRight="15dp" android:id="@+id/eyes" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@drawable/eyes1" />
<LinearLayout android:layout_marginTop="50dp" android:layout_height="wrap_content" android:layout_width="fill_parent" android:orientation="horizontal">
<Button android:id="@+id/eyesback" android:layout_width="50dp" android:layout_height="50dp" />
<Button android:id="@+id/eyesforward" android:layout_height="50dp" android:layout_width="50dp" android:layout_gravity="right"></Button>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
它可能我也错过了一些简单的东西。感谢您的帮助。
【问题讨论】: