Android soft keyboard resize layout

2019-01-19 10:43发布

When the virtual keyboard opens, it resizes my layout. How can i made for put the keyboard on my layout? And what it doesn't re-size my layout?

4条回答
ら.Afraid
2楼-- · 2019-01-19 10:55

Use adjustpan

The activity's main window is not resized to make room for the soft keyboard. Rather, the contents of the window are automatically panned so that the current focus is never obscured by the keyboard and users can always see what they are typing. This is generally less desirable than resizing, because the user may need to close the soft keyboard to get at and interact with obscured parts of the window.

查看更多
叛逆
3楼-- · 2019-01-19 10:58

You can use manifest flags to configure the effect of the virtual keyboard. See http://developer.android.com/guide/topics/manifest/activity-element.html#wsoft

查看更多
相关推荐>>
4楼-- · 2019-01-19 11:02

use only this code:

    <application
    android:windowSoftInputMode="adjustPan"
    </application>

used in manifest-application tag for all application

查看更多
Rolldiameter
5楼-- · 2019-01-19 11:03

Android soft keyboard resize layout

<activity android:name=".activity.SignUpActivity"
    android:screenOrientation="portrait"
    android:theme="@style/AppTheme.NoActionBar"
    android:windowSoftInputMode="adjustResize" />

It's Working for me try it.

查看更多
登录 后发表回答