所以我正在为我的 android 应用程序处理登录和注册页面,我正在尝试实现这个布局,但我无法让它正常工作。
我正在寻找的所需布局是这样的。
背景图像覆盖整个屏幕,然后在右上角有一个按钮,在中间底部有一个按钮。
但这就是我从实施设计中得到的
这就是我在布局文件中写下的
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" android:fitsSystemWindows="true" android:alwaysDrawnWithCache="false"
android:layout_gravity="center">
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:scaleType="center"
android:layout_alignParentTop="true" android:src="@drawable/nyork2"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="top" >
<Button
android:id="@+id/register"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="left"
android:text="@string/button_register"
/>
<Button
android:id="@+id/login"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="left"
android:text="@string/button_login"
/>
</LinearLayout>
</RelativeLayout>