java – 需要键盘上方的上一个和下一个按钮

我想用键盘上方的Prev,Next Buttons显示虚拟键盘.

当用户单击prev按钮时,光标应移至上一个编辑文本输入字段,单击下一个按钮应转到视图中的下一个编辑文本字段.

我想在我自己的活动中使用这些按钮.我怎样才能做到这一点?

解决方法:

这可以通过将android:windowSoftInputMode =“adjustPan”添加到activity来实现
清单中的元素.例如.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.codename.android"
      android:versionCode="1"
      android:versionName="1.0">
    <application android:icon="@drawable/icon" 
        android:label="@string/app_name"
        android:theme="@style/MyTheme"
        >

        <activity android:name=".MainActivity"
                  android:label="@string/app_name"
                  android:windowSoftInputMode="adjustPan">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
    <uses-sdk android:minSdkVersion="7" />
</manifest> 

这可以防止在显示虚拟键盘时调整视图大小.

上一篇:[QT] #1 Qt 的基本介绍与 MFC


下一篇:Windows10设置默认简体美式键盘输入法