我在android 9中面临的问题是,android底部的软键按钮隐藏了textview和按钮

我在android 9中面临的问题是,android底部的软键按钮隐藏了textview和按钮,android,android-layout,android-9.0-pie,android-softbuttons,Android,Android Layout,Android 9.0 Pie,Android Softbuttons,当我从底部软键按下后退按钮时,将显示buttom按钮, 但当应用程序最初加载时,按钮将隐藏在软键下方。 除了软键底部的android 9 pie外,该应用程序在所有版本中都运行良好。 我试过下面的方法,但没有成功 第一步 android:windowSoftInputMode="adjustResize" in manifest 第二步 mainView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE); 第三步

当我从底部软键按下后退按钮时,将显示
buttom按钮
, 但当应用程序最初加载时,
按钮将隐藏在软键下方。
除了软键底部的android 9 pie外,该应用程序在所有版本中都运行良好。
我试过下面的方法,但没有成功

第一步

android:windowSoftInputMode="adjustResize" in manifest
第二步

mainView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
第三步

getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
第四步

getWindow().getDecorView().setSystemUiVisibility(
                View.SYSTEM_UI_FLAG_LAYOUT_STABLE
                        | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                        | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                        | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
                        | View.SYSTEM_UI_FLAG_FULLSCREEN`enter code here
                        | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
我被这个问题困住了,提前谢谢。 这是我的布局Xml代码

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/main_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/main_bg">

    <RelativeLayout
        android:background="@color/dark_blue_color"
        android:id="@+id/action_bar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true">
        <!--android:background="@color/dark_blue_color"-->
        <ImageButton
            android:id="@+id/back_btn"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_centerVertical="true"
            android:background="@null"
            android:tint="@color/tint_color"
            android:src="@drawable/btn_back" />

        <TextView
            android:id="@+id/title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:layout_centerHorizontal="true"
            android:layout_toLeftOf="@id/call_btn"
            android:layout_toRightOf="@+id/back_btn"
            android:ellipsize="end"
            android:gravity="center"
            android:maxLines="1"
            android:text="Booking"
            android:textColor="@color/primary_text_color"
            android:textSize="27sp" />

        <ImageButton
            android:id="@+id/call_btn"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:layout_centerVertical="true"
            android:background="@null"
            android:padding="15dp"
            android:tint="@color/tint_color"
            android:src="@drawable/btn_cal" />

        <ImageButton
            android:id="@+id/help_btn"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:layout_centerVertical="true"
            android:layout_marginRight="10dp"
            android:background="@drawable/round_help_icon"
            android:backgroundTint="@color/text_color_white"
            android:clickable="true"
            android:padding="15dp"
            android:tint="@android:color/white"
            android:visibility="gone" />

    </RelativeLayout>

    <RelativeLayout
        android:id="@+id/alert_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:background="@drawable/alert_bg"
        android:visibility="gone">

        <include layout="@layout/alert_layout" />

    </RelativeLayout>

    <View
        android:alpha="0.2"
        android:id="@+id/view1"
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:layout_below="@+id/action_bar"
        android:background="@color/view_tint_color" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        android:layout_below="@+id/view1"
        android:weightSum="1">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:orientation="vertical"
            android:layout_weight="0.9"
            android:weightSum="1">

            <ScrollView
                android:id="@+id/container_scroll"
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_marginLeft="15dp"
                android:layout_marginTop="20dp"
                android:layout_marginRight="15dp"
                android:layout_marginBottom="10dp"
                android:paddingBottom="5dp"
                android:layout_weight="1"
                android:scrollbars="none">

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:orientation="vertical">

                    <appname.Views.FlowLayout xmlns:f="http://schemas.android.com/apk/res/appname"
                        android:id="@+id/container"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        f:horizontalSpacing="4dp"
                        f:verticalSpacing="10dp">

                    </appname.Views.FlowLayout>

                </LinearLayout>

            </ScrollView>

        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:orientation="vertical"
            android:layout_weight="0.1"
            android:weightSum="1">

            <FrameLayout
                android:layout_gravity="center"
                android:id="@+id/continue_btn"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_alignParentBottom="true"
                android:layout_centerHorizontal="true"
                android:focusable="true"
                android:layout_marginBottom="10dp"
                android:background="@drawable/button">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center"
                    android:gravity="center"
                    android:textStyle="bold"
                    android:text="@string/continue_txt"
                    android:textAllCaps="false"
                    android:textColor="@color/text_color_white"
                    android:textSize="18sp" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_vertical|right"
                    android:layout_marginRight="10dp"
                    android:text=""
                    android:textColor="@color/text_color_white"
                    android:textSize="15sp"
                    android:textStyle="bold" />

                <ImageView
                    android:id="@+id/indicator_img"
                    android:layout_width="30dp"
                    android:layout_height="30dp"
                    android:layout_gravity="center_vertical|left"
                    android:layout_marginLeft="10dp"
                    android:adjustViewBounds="true"
                    android:scaleType="centerCrop"/>

            </FrameLayout>

        </LinearLayout>


    </LinearLayout>


    </LinearLayout>

</RelativeLayout>


请显示您的布局。所以我们可以以适当的方式帮助您。@Kaushanpanchal我添加了布局文件。请显示您的布局。所以我们可以以适当的方式帮助您。@Kaushanpanchal我添加了布局文件。