当键盘在安卓系统中弹出时,布局会缩小。

3

我正在开发一个应用程序,我已经设置了

enter code here
<activity
        android:name=".ui.base.BaseActivity"
        android:windowSoftInputMode="adjustResize|stateHidden|adjustPan|stateAlwaysHidden"
        android:theme="@style/MyTheme"/>

在这个活动中,我使用了不同的碎片,并且所有的布局都在收缩。如果您需要任何代码,请告诉我并帮忙解决问题。 谢谢 我分享了我的屏幕图片,请检查。enter image description here 这个布局是主页活动。
enter code here
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white"
android:orientation="vertical"
android:isScrollContainer="false">

<include
    android:id="@+id/actionbar"
    layout="@layout/actionbar"
    android:layout_width="match_parent"
    android:layout_height="48dp" />

<FrameLayout
    android:id="@+id/base_container"
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_above="@+id/tab_layout"
    android:layout_alignParentTop="true"
    android:layout_weight="1">

</FrameLayout>

<View
    android:layout_width="match_parent"
    android:layout_height="0.5dp"
    android:background="@color/light_grey"/>

<LinearLayout
    android:id="@+id/tab_layout"
    android:layout_width="match_parent"
    android:layout_height="50dp"
    android:layout_alignParentBottom="true"
    android:background="@color/white"
    android:padding="@dimen/tab_horizontal_margin"
    android:orientation="horizontal">

    <!--android:background="@color/tab_background_color"-->


    <include
        android:id="@+id/tab_1"
        layout="@layout/activity_base_item"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:layout_gravity="center_vertical"/>

    <include
        android:id="@+id/tab_2"
        layout="@layout/activity_base_item"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:layout_gravity="center_vertical"/>

    <include
        android:id="@+id/tab_3"
        layout="@layout/activity_base_item"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:layout_gravity="center_vertical"/>

    <include
        android:id="@+id/tab_4"
        layout="@layout/activity_base_item"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:layout_gravity="center_vertical"/>

    <include
        android:id="@+id/tab_5"
        layout="@layout/activity_base_item"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:layout_gravity="center_vertical"/>

</LinearLayout>
</LinearLayout>

添加你的布局代码。 - Mujammil Ahamed
我已经添加了我的 XML 代码,请检查。 - Sid.The.Biker
将您的根视图(线性布局)转换为滚动视图,并将线性布局添加为其子项的滚动视图。 - Mujammil Ahamed
我试过了,但是布局会被滚动,我不想它被固定,因为顶部有ActionBar和底部有一个固定的布局。 - Sid.The.Biker
1个回答

1
将此添加到您的清单中。
<activity
android:name="com.companyname.applicationname"
android:windowSoftInputMode="stateVisible|adjustPan">

如果您正在使用ScrollView,请添加以下内容。
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:isScrollContainer="false">


我没有使用ScrollView。 - Sid.The.Biker

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接