There is a scrollview & button(at the bottom) inside linear layout. Toolbar is fixed for the screen. When keyboard opens, button moves up. I want the button not to move up.
Asked
Active
Viewed 3,726 times
5 Answers
1
Use the below code to change the your manifest.xml ,,For which xml layout contains activity.
android:windowSoftInputMode="stateUnchanged|adjustResize"
OR
android:windowSoftInputMode="adjustPan|adjustResize"
Change in MANIFEST FILE
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.adjustscroll.MainActivity"
android:label="@string/app_name"
android:windowSoftInputMode="stateUnchanged|adjustResize"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Hope this will help you. Let me know if solved.
V-rund Puro-hit
- 5,418
- 9
- 29
- 50
Andolasoft
- 1,276
- 1
- 7
- 16
-
this is right done by using android:windowSoftInputMode="adjustPan|adjustResize" ,, thanks – Zain Apr 13 '19 at 15:48
-
-
@ArnoldBrown I guess I have trouble with that.. Can you please check in [here](https://stackoverflow.com/questions/59492019/making-the-whole-layout-smaller-when-the-keyboard-appears/59492293#59492293) – Zain Feb 08 '20 at 12:59
0
If you are using Fragment write the below code in onCreateView:
getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
kgandroid
- 5,459
- 5
- 37
- 68
0
In your XML file, you can use ScrollView:
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<!--your layout-->
</ScrollView>
cake double
- 60
- 5
0
Make sure your activity has the following attribute in your AndroidManifest.xml
android:windowSoftInputMode="adjustResize"
Also in the layout xml file has LinearLayout as the parent for Button and EditText.
LvN
- 671
- 1
- 5
- 21
0
Here issue with manifest property for that activity.
Have you added any property at manifest like below ?
android:windowSoftInputMode="adjustPan"
Or
android:windowSoftInputMode="adjustResize"
ViramP
- 1,501
- 10
- 11