android keyboard pushing up actionbar -


when click edittextform, keyboard pops , pushes actionbars second fragment.

before

after

i'm using viewpager in mainactiviy. above screenshot in second fragment of 3.

this layout of second fragment.

<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android"     android:orientation="vertical"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:paddingbottom="@dimen/activity_vertical_margin"     android:paddingleft="@dimen/activity_horizontal_margin"     android:paddingright="@dimen/activity_horizontal_margin"     android:paddingtop="@dimen/activity_vertical_margin">      <linearlayout         android:layout_width="match_parent"         android:layout_height="50dp"         android:layout_marginbottom="30dp"         android:background="@color/edittextcolor"         >         <edittext             android:layout_width="match_parent"             android:layout_height="match_parent"             android:inputtype="text"             android:hint="query"             android:ems="10"             android:id="@+id/query"             android:layout_weight="0.3"             />          <button             android:backgroundtint="@color/button1"             android:textcolor="@color/buttontext"             android:layout_width="match_parent"             android:layout_height="match_parent"             android:drawabletop="@drawable/search_picto"             android:id="@+id/searchbooks"             android:layout_weight="0.7"             />     </linearlayout>      <linearlayout         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:padding="8dp"         android:baselinealigned="false">         <linearlayout             android:layout_width="match_parent"             android:layout_height="wrap_content"             android:layout_marginstart="2dp"             android:layout_marginend="2dp"             android:orientation="vertical"             android:layout_weight="1">             <com.seokyeong.adw.sku_library.custormizes.squaredrawablebutton                 android:drawabletop="@drawable/seat_info_picto"                 android:backgroundtint="@color/button1"                 android:layout_width="match_parent"                 android:layout_height="120dp"                 android:id="@+id/seat_info"                 />             <com.seokyeong.adw.sku_library.custormizes.squaredrawablebutton                 android:backgroundtint="@color/button1"                 android:layout_width="match_parent"                 android:layout_height="120dp"                 />         </linearlayout>         <linearlayout             android:layout_width="match_parent"             android:layout_height="wrap_content"             android:layout_marginstart="2dp"             android:layout_marginend="2dp"             android:orientation="vertical"             android:layout_weight="1">             <com.seokyeong.adw.sku_library.custormizes.squaredrawablebutton                 android:drawabletop="@drawable/pt_room_picto"                 android:backgroundtint="@color/button1"                 android:text="시설 예약"                 android:id="@+id/room_reservation"                 android:layout_width="match_parent"                 android:layout_height="120dp"                 />             <com.seokyeong.adw.sku_library.custormizes.squaredrawablebutton                 android:backgroundtint="@color/button1"                 android:layout_width="match_parent"                 android:layout_height="120dp"                 />         </linearlayout>         <linearlayout             android:layout_width="match_parent"             android:layout_height="wrap_content"             android:layout_marginstart="2dp"             android:layout_marginend="2dp"             android:orientation="vertical"             android:layout_weight="1">             <com.seokyeong.adw.sku_library.custormizes.squaredrawablebutton                 android:backgroundtint="@color/button1"                 android:drawabletop="@drawable/bookmark_picto"                 android:id="@+id/bookmarks"                 android:text="관심 도서"                 android:layout_width="match_parent"                 android:layout_height="120dp"                 />             <com.seokyeong.adw.sku_library.custormizes.squaredrawablebutton                 android:backgroundtint="@color/button1"                 android:layout_width="match_parent"                 android:layout_height="120dp"                 />         </linearlayout>     </linearlayout>  </linearlayout> 

i tried adding adjustnothing or adjustpan option in mainactiviy, androidmanifest.xml. it's not work.

also add getactivity().getwindow().setsoftinputmode(windowmanager.layoutparams.soft_input_state_hidden |windowmanager.layoutparams.soft_input_adjust_resize); in fragments class

how can stop keyboard ruin layout?


activity.xml

<?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.coordinatorlayout xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:app="http://schemas.android.com/apk/res-auto"     xmlns:tools="http://schemas.android.com/tools"     android:id="@+id/main_content"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:fitssystemwindows="true"     tools:context="com.seokyeong.adw.sku_library.activitys.mainactivity">      <android.support.design.widget.appbarlayout         android:id="@+id/appbar"         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:paddingtop="@dimen/appbar_padding_top"         android:theme="@style/apptheme.appbaroverlay">          <android.support.v7.widget.toolbar             android:id="@+id/toolbar"             android:layout_width="match_parent"             android:layout_height="?attr/actionbarsize"             android:background="?attr/colorprimary"             app:layout_scrollflags="scroll|enteralways"             app:popuptheme="@style/apptheme.popupoverlay">          </android.support.v7.widget.toolbar>      </android.support.design.widget.appbarlayout>      <android.support.v4.view.viewpager         android:id="@+id/container"         android:background="@color/main_background"         android:layout_width="match_parent"         android:layout_height="match_parent"         app:layout_behavior="@string/appbar_scrolling_view_behavior" />  </android.support.design.widget.coordinatorlayout> 

try removing line - app:layout_scrollflags="scroll|enteralways" toolbar view.


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -