Keyboard appears on top of edit text

Discussion in 'Bugs & wishlist' started by nickkat, Oct 21, 2011.

  1. nickkat

    nickkat New Member Licensed 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.
     

    Attached Files:

    Last edited: Oct 21, 2011
  2. Erel

    Erel Administrator Staff Member Licensed User

    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:
    Code:
    android:windowSoftInputMode="stateHidden|adjustPan"
    Don't forget to check Do Not Override Manifest File.
     
    Indra Wirawan likes this.
  3. rgately

    rgately Member Licensed 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.
     
  4. cmweb

    cmweb Active Member Licensed User

    Hello Erel,

    wouldn't it be a good idea to have that feature as option within the B4A IDE?

    Best regards,

    Carsten
     
  5. mc73

    mc73 Well-Known Member Licensed User

    I've added
    Code:
    <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.
     
  6. Roger Garstang

    Roger Garstang Well-Known Member Licensed 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.
     
  7. Roger Garstang

    Roger Garstang Well-Known Member Licensed User

    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.basic4ppc.com/forum/basi...s/14832-handle-soft-keyboard-ime-library.html

    and for the .visibility issue-

    http://www.basic4ppc.com/forum/bugs-wishlist/17503-bug-ime-library-visible.html
     
    Last edited: May 9, 2012
  8. Rick Harris

    Rick Harris Well-Known Member Licensed User

    I have found out that this addition to the manifest is the one to use:
    Code:
    SetActivityAttribute(main, android:windowSoftInputMode, adjustPan|stateHidden)
     
  9. pozzari

    pozzari New Member Licensed 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:
    Code:
    '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.basic4ppc.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.
     
  10. Erel

    Erel Administrator Staff Member Licensed User

    Please start a new thread for this question.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice