1. *** New version of B4J is available ***
    B4J v7.8
    Dismiss Notice

iOS Question View over the keyboard

Discussion in 'iOS Questions' started by Alexander Stolte, May 21, 2018.

  1. Alexander Stolte

    Alexander Stolte Well-Known Member Licensed User

    Hello,

    i did a tutorial on how to place a view over the keyboard on android.

    But now i'm on IOS, i have search in the Forum here, but I did not find anything that helped me.

    I found this Function: "CalcRelativeKeyboardHeight".

    This do not work:
    Code:
    pnl_ground.Top = pnl_ground.CalcRelativeKeyboardHeight(Height)
    How can i calculate the top value, so i can place my view over the keyboard?

    i try this too:
    Code:
    pnl_ground.Top = Height - pnl_ground.Height
     
  2. Erel

    Erel Administrator Staff Member Licensed User

  3. Alexander Stolte

    Alexander Stolte Well-Known Member Licensed User

    is there no way to calculate this with the "CalcRelativeKeyboardHeight" function?
     
  4. Erel

    Erel Administrator Staff Member Licensed User

  5. Alexander Stolte

    Alexander Stolte Well-Known Member Licensed User

    I think i got it. But it is not 100% clean i think. This code move the panel bottom to the top of the Keyboard
    Code:
    Dim ff As Int = pnl_ground.CalcRelativeKeyboardHeight(Height)
            
    Dim ff2 As Int = Page1.RootPanel.Height -  pnl_ground.Top
          
            pnl_ground.Top = ff2 - ff +
    135dip
     
  6. Alexander Stolte

    Alexander Stolte Well-Known Member Licensed User

    Better Solution and the ultimate Solution:
    Code:
    Sub page_KeyboardStateChanged (Height As Float)

    Dim tmp_value as float = page.RootPanel.Height -Height
    mypanel.Top = newrootheight - mypanel.Height

    End Sub
     
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