开发者

Soft Keyboard comes over the EditText

开发者 https://www.devze.com 2023-02-08 12:28 出处:网络
I am using Appcelerator\'s Titanium to develop an Android application. When focus开发者_开发知识库 comes over one of the EditText(at lower end of page) the keypad covers the EditText so when I am keyi

I am using Appcelerator's Titanium to develop an Android application. When focus开发者_开发知识库 comes over one of the EditText(at lower end of page) the keypad covers the EditText so when I am keying text, I can't see what's being keyed in. What are my options ?

  1. How to move EditText higher on the screen ?
  2. Some applications show "model" form behavior where just that EditText & keyboard shows, any examples of how to do this?


Ensure that you have specified the Window Adjustment Mode in your AndroidManifest.xml file for the Activityin which you want to control the SoftKeyboard

Like this:

<activity name="YourActivity"
    android:windowSoftInputMode="stateVisible|adjustResize">
</activity>

or

<activity name="YourActivity"
    android:windowSoftInputMode="stateVisible|adjustPan">
</activity>

Refer this : Enabling resize mode and other window features


In my case after struggling came to know that it is depends on your layout alignment

If you are showing the full screen with out status bar ...

The property .. adjust pan or adjust resize won't work to move the edit text up when keyboard showing.. the entire layout including above the views of edit text also moves up

-- the solution is I have removed the option to show the full screen in manifest file and used windows soft input to 'resize' in the manifest file.

Thanks Vinod Sakala


At creation time of a window, add the windowSoftInputMode property.

var win1 = Ti.UI.createWindow({
    // ...
    // add here your other window properties
    // ...
    windowSoftInputMode: Ti.UI.Android.SOFT_INPUT_ADJUST_PAN
});

see Titanium API

0

精彩评论

暂无评论...
验证码 换一张
取 消