How do I make my ScrollView dynamically change when adding lines to my EditText?

好久不见. 提交于 2020-01-16 11:15:07

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!