Android Question top panel dissapears when keyboard is opened

Discussion in 'Android Questions' started by leitor79, Mar 12, 2015.

  1. leitor79

    leitor79 Active Member Licensed User

    Hi,

    I have a layout with a top panel, a middle listbox and a bottom panel.

    It's scripted like this:

    Code:
    'All variants script
    AutoScaleAll
    pnlTop.Left=
    0
    pnlTop.Top=
    0
    pnlTop.Width=
    100%x
    pnlTop.Height=
    50dip

    pnlBottom.Left=
    0
    pnlBottom.Top=
    100%y - 50dip
    pnlBottom.Width=
    100%x
    pnlBottom.Height=
    50dip

    lstItems.Top=pnlTop.Height
    lstItems.Left=
    0
    lstItems.Width=
    100%x
    lstItems.Height=
    100%y - pnlBottom.Height
    I have an editbox somewhere. When I hit the editbox, the keyboard is opened (good!), but the top panel dissapears. I see the list (I don't know how much of the list since I don't have items there yet), and almost all bottom panel (except for 8 pixeles margin the keyboard overlaps the bottom of the bottom panel)

    It's ok this behaviour with my current layout? Should I change the layout, the script or should I do something when the keyboard is opened?

    Thank you very much!
     
  2. Erel

    Erel Administrator Staff Member Licensed User

  3. leitor79

    leitor79 Active Member Licensed User

    Hi Erel,


    Thank you for your answer.

    I've read that, but I'm puzzled... I don't follow the logic of the keyboard redimension...

    If the opened keyboard changes the screen or layout or activity size... shouldn't the top panel be located at the same position because how it's defined the script?

    pnlTop.Left=0
    pnlTop.Top=0
    pnlTop.Width=100%x
    pnlTop.Height=50dip

    Thank you very much!
     
    Last edited: Mar 12, 2015
  4. Erel

    Erel Administrator Staff Member Licensed User

    No. The designer script and anchors are only applied when the layout is loaded.

    The default behavior of Android is adjustPan mode. In this mode it just pushes all the views upwards to make the text field visible. You will need to switch to adjustResize mode and handle the UI change yourself.
     
  5. leitor79

    leitor79 Active Member Licensed User

    Thank you very much for your explanation, Erel!
     
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