clcurie_11 2013-05-16 02:44 采纳率: 6.7%
浏览 5028
已采纳

键盘出现时 ScrollView 不能滚动

我设置的一个布局有一些 view,有一个是 EditText。布局正好符合一个页面。但是,当软键盘弹出时,布局不能滚动:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/background" >
    <ScrollView
        android:id="@+id/ScrollView1"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true" >
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical" >
            <CheckBox/>
            <TextView/>
            <LinearLayout>
                <EditText>
                    <requestFocus />
                </EditText>
            </LinearLayout>
            <TextView/>
            <LinearLayout>
                <Spinner/>
            </LinearLayout>
        </LinearLayout>
    </ScrollView>
    <Button
        android:layout_alignParentBottom="true" />
</RelativeLayout>

在 manifest 中我申明属性:

android:windowSoftInputMode="adjustResize|stateHidden"

如何让它正常执行呢?

  • 写回答

2条回答

  • luhuajcdd 2013-05-16 02:49
    关注

    <ScrollView 要在这个最下面Button上面
    android:layout_above

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作