gpt4 book ai didi

Android ScrollView - 显示键盘时需要滚动 - 尽管数据少于 1 页

转载 作者:行者123 更新时间:2023-11-30 04:16:55 25 4
gpt4 key购买 nike

我有一个 Activity 在屏幕上显示的数据少于 1 页。因此,当我按下屏幕上的编辑框时,键盘会隐藏 UI 组件(位于其下方)。

问题是没有启用滚动(因为数据量很大)。如何强制滚动?

最佳答案

您应该使用 ScrollView 围绕您的布局。

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >

<EditText
android:id="@+id/editText1"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:inputType="text" >

<requestFocus />
</EditText>
</LinearLayout>
</ScrollView>

关于Android ScrollView - 显示键盘时需要滚动 - 尽管数据少于 1 页,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9823831/

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