0

Layout MockI have a decorated (Framed) EditText which I use in my app. When the soft keyboard comes up it hides the part of the frame that is below the text view. For the frame functionality I use a LinearLayout which contains the EditText.

Is there a way to set the keyboard not to hide the bottom part of the frame(The containing Layout)?

Edit: I guess I am not explaining myself properly. The Linear layout containing the EditText is not the main fragment layout, it is contained in it and is used as a decorator for it. what I am basically trying to do is set a margin between the keyboard and the EditText so that the keyboard doesn't hide the surrounding LinearLayout which is again, not the main layout for the fragment.

In the mock, the problem is that the keyboard goes up all the way to the bottom of the EditText and covers the bottom part of the wrapper layout. I need the entire wrapper layout to be seen. Any Ideas.

  • Possible duplicate of [Android soft keyboard covers edittext field](http://stackoverflow.com/questions/3295672/android-soft-keyboard-covers-edittext-field) – Linh Apr 04 '16 at 07:45

2 Answers2

0

You have to wrap your linear layout within ScrollView with the following property android:fillViewport="true" and in manifest write down the following line of code `android:windowSoftInputMode="adjustResize".

Saurabh Vardani
  • 1,821
  • 2
  • 18
  • 33
  • tried already. The EditText is not hidden, the surrounding layout is. – Yanay Zimran Apr 04 '16 at 12:12
  • convert your linear layout to relative layout and add the following line of code into it android:layout_alignParentBottom="true" – Saurabh Vardani Apr 04 '16 at 12:15
  • I guess I am not explaining myself properly. The Linear layout containing the EditText is not the main fragment layout, it is contained in it and is used as a decorator for it. what I am basically trying to do is set a margin between the keyboard and the EditText so that the keyboard doesn't hide the surrounding LinearLayout which is again, not the main layout for the fragment. – Yanay Zimran Apr 04 '16 at 12:51
0

Set all your Activity view or layout in ScrollView.

Which will make your view scrollup when soft keyboard open and it don't hide your view.

iTag
  • 1
  • 2