简体   繁体   English

如何创建这样的android布局?

[英]How to create a android layout like this?

How to create a layout like this in android studio. 如何在android studio中创建这样的布局。

Image as background + text centered horizontally and vertically + buttons: 图像为背景+文本在水平和垂直居中+按钮:

在此处输入图片说明

You can simply use a RelativeLayout and place all the elements accordingly to the others. 您可以简单地使用RelativeLayout并将所有元素相应地放置到其他元素上。

Something like: 就像是:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent" android:layout_height="match_parent">

    <ImageView
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

    <TextView
        android:id="@+id/centered_text"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true" />

    <LinearLayout
        android:id="@+id/bottom_right_container"
        android:layout_alignParentRight="true"
        android:layout_alignParentBottom="true"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />

        <!-- the stuff bottom right -->

    </LinearLayout>

</RelativeLayout>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM