android - Layout gets adjusted when keyboard shows -
in layout have admob advertisement showing edittext
in layout. when focus in edit text type keyboard appears , moves admob advertisement on edittext , cant see typing in.
this layout
<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads" android:layout_width="match_parent" android:layout_height="match_parent" android:isscrollcontainer="false" > <scrollview android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/wood_floor" > <relativelayout android:layout_width="match_parent" android:layout_height="wrap_content" > <com.tyczj.bowling.adapters.robotothintextview android:id="@+id/textview2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginleft="40dp" android:layout_margintop="30dp" android:text="add bowler" android:textappearance="?android:attr/textappearancelarge" android:textcolor="#33b5e5" android:textsize="40dp" /> <framelayout android:id="@+id/line" android:layout_width="fill_parent" android:layout_height="2dp" android:layout_alignparentleft="true" android:layout_below="@+id/textview2" android:layout_marginleft="20dp" android:layout_marginright="20dp" android:layout_margintop="8dp" android:background="@drawable/ab_solid_custom_blue_inverse_holo" > </framelayout> <com.tyczj.bowling.adapters.robotothintextview android:id="@+id/textview1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignleft="@+id/line" android:layout_below="@+id/line" android:layout_margintop="20dp" android:text="@string/bnametv" android:textappearance="?android:attr/textappearancemedium" /> <edittext android:id="@+id/edittext1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignbottom="@+id/textview1" android:layout_below="@+id/line" android:layout_marginleft="30dp" android:layout_marginright="20dp" android:layout_torightof="@+id/textview1" android:inputtype="textcapsentences" > <requestfocus /> </edittext> <edittext android:id="@+id/edittext2" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignbottom="@+id/textview3" android:layout_below="@+id/edittext1" android:layout_marginleft="30dp" android:layout_marginright="20dp" android:layout_torightof="@+id/textview3" android:inputtype="textcapsentences" > <requestfocus /> </edittext> <com.tyczj.bowling.adapters.robotothintextview android:id="@+id/textview3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignleft="@+id/line" android:layout_below="@+id/textview1" android:layout_margintop="20dp" android:text="@string/lnametv" android:textappearance="?android:attr/textappearancemedium" /> <radiobutton android:id="@+id/radiobutton1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignleft="@+id/textview3" android:layout_below="@+id/textview3" android:layout_margintop="15dp" android:checked="true" android:text="right handed" /> <radiobutton android:id="@+id/radiobutton2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignleft="@+id/line" android:layout_below="@+id/radiobutton1" android:text="left handed" /> <button android:id="@+id/done" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignleft="@+id/line" android:layout_alignparentbottom="true" android:layout_below="@+id/radiobutton2" android:onclick="ondoneclick" android:text="@string/done" /> </relativelayout> </scrollview> <com.google.ads.adview android:id="@+id/ad" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignparentbottom="true" ads:adsize="iab_banner" ads:loadadoncreate="true" /> </relativelayout>
in manifest set android:windowsoftinputmode="statevisible|adjustresize"
in activity didnt have effect
how can stop advertisement moving when keyboard appears?
have tried mode adjustpan? may work improve you. since have relativelayout element aligned bottom of screen, adjustresize maintain element @ bottom of screen. may able play layout prepare things laying advertisement out beingness below scrollview, rather aligning bottom.
android android-layout
No comments:
Post a Comment