Reputation: 149
When I open my EditText
on my app I see that my EditText
opens to fullscreen. When I focus on EditText
I need to resize this field for my keyboard automatically
My code:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<EditText
android:id="@+id/etFName"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="top"
android:singleLine="false"
android:inputType="textMultiLine"
android:isScrollContainer="false" />
<Button
android:id="@+id/btnCancelPost"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="Cancel" />
`
Upvotes: 1
Views: 172
Reputation: 1601
Add this code to your activity in AndroidManifest file
android:windowSoftInputMode="adjustResize"
Upvotes: 1