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 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题
  • ¥20 yolov5自定义Prune报错,如何解决?