gpt4 book ai didi

android - 在 android 中打开键盘时如何在 View 中滚动?

转载 作者:太空宇宙 更新时间:2023-11-03 12:58:45 26 4
gpt4 key购买 nike

我在 ScrollView 中有许多编辑文本,当它们超过屏幕容量时,当键盘打开时,很难执行平滑滚动。这是我的代码。

     <ScrollView 
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<EditText
android:layout_width="200dp"
android:layout_height="wrap_content"
/>
<EditText
android:layout_width="200dp"
android:layout_height="wrap_content"
/>
<EditText
android:layout_width="200dp"
android:layout_height="wrap_content"
/>
<EditText
android:layout_width="200dp"
android:layout_height="wrap_content"
/>
<EditText
android:layout_width="200dp"
android:layout_height="wrap_content"
/>
</LinearLayout>
</ScrollView>

请通过一个很好的链接来指导我解决这个问题,或者如果有人知道,请回答同样的问题。

谢谢

最佳答案

android:windowSoftInputMode="adjustResize" 放在 list 文件中的 Activity 标签上。

它会起作用。

关于android - 在 android 中打开键盘时如何在 View 中滚动?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14891542/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com