我正在使用这种布局处理 Android 片段:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools"
android:background="@color/very_dark_transparent_grey"
tools:ignore="MissingPrefix">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:id="@+id/invite_code_input_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/spacing_semi_huge"
android:gravity="center_horizontal"
android:orientation="vertical">
<TextView
fontPath="fonts/helveticaneue/Helvetica Neu Bold.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/join_fragment_invite_code"
android:textColor="@color/white"
android:textSize="@dimen/font_larger" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingLeft="@dimen/spacing_huge"
android:paddingRight="@dimen/spacing_huge">
<io.brandie.brandie.custom.InviteCodeEditText
android:id="@+id/invite_code_edit_text"
fontPath="fonts/helveticaneue/Helvetica Neu Bold.ttf"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/spacing_smaller"
android:cursorVisible="false"
android:digits="1234567890"
android:inputType="number"
android:maxLength="6"
android:textIsSelectable="false"
android:textSize="32sp" />
</LinearLayout>
<TextView
fontPath="fonts/helveticaneue/Helvetica Neu Bold.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/spacing_large"
android:layout_marginBottom="@dimen/spacing_large"
android:text="@string/join_fragment_or"
android:textColor="@color/lightGreen"
android:textSize="@dimen/font_large"/>
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/invite_code_input_layout">
<RelativeLayout
android:id="@+id/message_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/request_to_join_text"
fontPath="fonts/helveticaneue/Helvetica Neu Bold.ttf" …Run Code Online (Sandbox Code Playgroud)