页面时软键盘poped向上滚动 [英] Page scroll when soft keyboard poped up

查看:241
本文介绍了页面时软键盘poped向上滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个<滚动型> 布局:

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/my_scrollview"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    >

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical" >

        <EditText
            android:id="@+id/input_one"
            android:layout_width="300dp"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:inputType="number" >

         <EditText
            android:id="@+id/input_two"
            android:layout_width="300dp"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:inputType="number" >

         <EditText
            android:id="@+id/input_three"
            android:layout_width="300dp"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:inputType="number" >

          <Button
            android:id="@+id/ok_btn"
            android:layout_width="200dp"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_marginTop="20dp"
            android:text="@string/ok_str" />

      </LinearLayout>
</ScrollView>

正如你看到的上面,简单的布局包括三个输入字段和一个确定按钮。

As you see above, the simple layout consists of three input fields and an "Ok" button.

我跑我的上述布局的应用程序,当我点击1号输入字段( @ + ID / input_one ),软键盘就会弹出从底部在屏幕上,它的隐藏第3个输入字段和确定按钮。

I run my app with the above layout, when I tap on the 1st input field (@+id/input_one), the soft keyboard will pop up from the bottom of the screen, it hides the 3rd input field and the "Ok" button.

由于我使用&LT;滚动型&GT; ,我想我可以滚动翻页才能看到第3个输入字段和确定按钮,这是隐伏按软键盘,但是页面不可滚动。为什么?如何摆脱它? 基本上,我希望看到每个输入字段和确定按钮,即使是软键盘poped了。

Since I use <ScrollView> , I thought I can scroll the page up in order to see the 3rd input field and "Ok" button which are hiden by the soft keyboard, but the page is not scrollable. Why? How to get rid of it? basically, i would like to see every input fields and "Ok" button even the soft keyboard poped up.

推荐答案

我固定的定义&LT下面的属性我的问题;活性GT; AndroidManifest。 XML

android:windowSoftInputMode="stateVisible|adjustResize"

这篇关于页面时软键盘poped向上滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆