Skip to content Skip to sidebar Skip to footer

How To Make Textview, Which Is Under Edit Text, Is Pushed Up With Keyboard Showing

I have the folowing layout Copy

In which activity you want to adjust keyboard add this line

android:windowSoftInputMode="adjustResize"

see screen Shots:

enter image description here

i hope its work for you

Solution 2:

a node with layout_height="match_parent" won't be pushed into any direction, because the layout has no space to move; this should be layout_height="wrap_content" ( "show layout boundaries"). adding android:windowSoftInputMode="adjustResize" or "adjustPan|adjustResize" to the activity in Manifest.xml should resize the layout, when the keyboard appears & disappears.

The activity's main window is always resized to make room for the soft keyboard on screen.

and that (or quite similar) effect is provided by material TextInputLayout:

anatomy of a TextInputLayout

api "com.google.android.material:material:1.0.0"

for example (notice the app:counterEnabled and app:counterMaxLength attributes):

<com.google.android.material.textfield.TextInputLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"><com.google.android.material.textfield.TextInputEditTextandroid:id="@+id/caption"android:layout_width="match_parent"android:layout_height="wrap_content"android:gravity="start"android:hint="@string/hint_caption"android:inputType="textNoSuggestions"android:text="@={item.caption}"app:counterEnabled="true"app:counterMaxLength="50"/></com.google.android.material.textfield.TextInputLayout>

Solution 3:

You need to this statement to manifest.xml.

android:windowSoftInputMode="stateVisible|adjustResize"

Make sure its under the activity the textview is declared in.

Post a Comment for "How To Make Textview, Which Is Under Edit Text, Is Pushed Up With Keyboard Showing"