当键盘打开android时,布局正在缩小

时间:2016-08-10 13:45:48

标签: android xml android-fragments

我正在开发一款应用,我已经设置了

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>

1 个答案:

答案 0 :(得分:0)

将此添加到您的清单

<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">

相关问题