[英]Layout is shrinking when keyboard opens android
I am working on an app and i have set 我正在开发一个应用程序,我已经设置好了
enter code here
<activity
android:name=".ui.base.BaseActivity"
android:windowSoftInputMode="adjustResize|stateHidden|adjustPan|stateAlwaysHidden"
android:theme="@style/MyTheme"/>
and in this activity i am using different fragments and than also all layouts are shrinking. 在这个活动中我使用不同的片段,而且所有布局都在缩小。 Please help if you want any codes please let me know.
如果您需要任何代码请帮助,请告诉我。 Thanks I am sharing you my screen image please check.
谢谢我分享你的屏幕图片请检查。
This layout is home activity 这种布局是家庭活动
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>
Add this to your manifest 将此添加到您的清单
<activity
android:name="com.companyname.applicationname"
android:windowSoftInputMode="stateVisible|adjustPan">
If you are using ScrollView add this 如果您使用ScrollView添加此项
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:isScrollContainer="false">
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.