问题
https://gyazo.com/1940054eacbe2e3388ac9e6da0eb2cb1
I have a linear layout, nested in a relative layout, nested in a scrollview. When I add lines to my EditText the scroll bar doesn't dynamically update, it still acts as if it's at the top of the page.
I have set the fillViewport of my ScrollViews to true, I have changed every imaginable component's height constraints to every possible variation of constraint.
Any ideas would be great, thanks
回答1:
It is happening because of soft-keyboard.Add this to your activity tag in your manifest file:
android:windowSoftInputMode="adjustResize"
OR
android:windowSoftInputMode="adjustPan"
for example:
<activity android:name=".MainActivity" android:windowSoftInputMode="adjustResize" android:screenOrientation="portrait" >
</activity>
来源:https://stackoverflow.com/questions/58901233/how-do-i-make-my-scrollview-dynamically-change-when-adding-lines-to-my-edittext