i have an activity with an editText field almost at the bottom. when i focus on that editText field the keyboard shows up and pushes my edittext field up.
when it stops there is no space between editText and my softkeyboard.
is it possible to add some margin?
this is my code:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/bg_yellow"
android:orientation="vertical"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_gravity="bottom"
android:layout_alignParentBottom="true"
android:paddingTop="25dp"
>
<RelativeLayout
android:layout_width="340dp"
android:layout_height="100dp"
android:layout_centerHorizontal="true"
>
<EditText
android:layout_width="340dp"
android:layout_height="45dp"
android:background="@drawable/edit_text_field"
android:inputType="text"
/>
</RelativeLayout>
</RelativeLayout>
position of editText field before keyboard shows up: http://postimg.org/image/826fwy18z/
and an image when keyboard is show up, with no space between cursor and keyboard: http://postimg.org/image/97qlfb4zx/
You can use android:windowSoftInputMode property of Activity in manifest file.
Use android:windowSoftInputMode="adjustResize" in your case. You can check other properties as well.
Hope this helps.
Thanks.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With