Keyboard appears on top of edit text

nickkat

New Member
Licensed User
Longtime User
I am having a problem with the keyboard hiding edit texts. If you have and edit text at the bottom of the screen and you click on it, the keyboard appears but it doesn't push the screen up. The keyboard appears on top of the edit text.

This usually happens if you have a listview thats hidden and you make it visible in the code.

Also happens if you load another layout.

Attached is an example.
 

Attachments

  • kbproblem.zip
    6.7 KB · Views: 687
Last edited:

rgately

Member
Licensed User
Longtime User
Erel,

Thanks for pointing me in the right direction. I haven't messed around with the manifest file yet but I will check the forum before I ask any questions about it.
 

cmweb

Active Member
Licensed User
Longtime User
Hello Erel,

The movement is handled by Android. If you want to force it to move then you can modify the manifest file and add adjustPan to windowSoftInputMode:
B4X:
android:windowSoftInputMode="stateHidden|adjustPan"
Don't forget to check Do Not Override Manifest File.
wouldn't it be a good idea to have that feature as option within the B4A IDE?

Best regards,

Carsten
 

mc73

Well-Known Member
Licensed User
Longtime User
I've added
B4X:
<android:windowSoftInputMode="stateHidden|adjustPan"/>
at the manifest file, inside the addManifestText, but I really don't know if this is the correct place, since it's not working for me. I have some textBoxes on a panel, the ones positioned in the down side of the panel, are not moving when keyboard appears, thus remaining hidden. Any idea what am I doing wrong? Thank you.
 

Roger Garstang

Well-Known Member
Licensed User
Longtime User
Sounds like you are having the same issue I was/am. I started out talking about it in the IME thread then posted it as a bug. You are correct in that it has to do with .visible being used in the code. Once I took my call out for that things worked. I was hiding a image though so was able to swap bitmaps to get the same effect...you may need to size your listview to 0 instead of hiding. For me adding the different Soft Input Mode flags to my Manifest just made things worse...especially when rotating the screen with the keyboard out once I thought I had it working.

Something happens when you set the visible status of a view that either aborts the panning and resizing code or calls it twice- once with the correct adjusted screen size and once with the full screen size with the keyboard still out so nothing gets adjusted.
 

Roger Garstang

Well-Known Member
Licensed User
Longtime User
wouldn't it be a good idea to have that feature as option within the B4A IDE?

It is, you can use the Manifest Editor. See the IME Library thread where Erel suggested it for another user where my comments I mentioned above are.

For the OP's app you'd just add SetActivityAttribute(main, android:windowSoftInputMode, adjustResize) to the Manifest file in the project menu. (Making the listview visible in the designer and taking out the .visible in code made the keyboard behave normal too)

http://www.b4x.com/forum/basic4andr...s/14832-handle-soft-keyboard-ime-library.html

and for the .visibility issue-

http://www.b4x.com/forum/bugs-wishlist/17503-bug-ime-library-visible.html
 
Last edited:

pozzari

New Member
Licensed User
Longtime User
Hi all
in portrait the EditText goes to the visible area, but in landscape nothing moves, and the android create a big white box to write the text.
My manifest:
B4X:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: http://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="14"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
'SetActivityAttribute(main, android:windowSoftInputMode, stateAlwaysVisible)   
'SetActivityAttribute(main, android:windowSoftInputMode, adjustResize)
'SetActivityAttribute(main, android:windowSoftInputMode, adjustResize|stateHidden)
'SetActivityAttribute(main, android:windowSoftInputMode, adjustResize|stateAlwaysVisible)
'SetActivityAttribute(main, android:windowSoftInputMode, adjustPan|stateHidden)
SetActivityAttribute(main, android:windowSoftInputMode, adjustPan|stateHidden)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
'End of default text.
 
Top