iOS Question TextField in ScrollView

Discussion in 'iOS Questions' started by Tomas Petrus, Aug 24, 2015.

  1. Tomas Petrus

    Tomas Petrus Active Member Licensed User

    Hi,

    I have App with some TextFields and everything is in ScrollView. I have problem with focus in TextField, because it is hidden behind keyboard and I must scroll to that field. Is there any way how to automatic scroll on that field?

    Thanks for answer
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    You should handle the Page_KeyboardStateChanged event:
    Code:
    Sub Page1_KeyboardStateChanged (Height As Float)
       
    End Sub
     
  3. Tomas Petrus

    Tomas Petrus Active Member Licensed User

    Tnaks for answer.

    What should be in that event. Is this right?

    Code:
    ScrollView1.ScrollTo(0,Height,False)
    thanks
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Not exactly.
    Try this:
    Code:
    If Height > 0 Then
       sv.ScrollTo(
    0, sv.ScrollOffsetY + Height, True)
    End If
     
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