Keyboard Slide

  1. 3 months ago

    Dave S

    Apr 13 San Diego, California USA

    Does "Xojo for iOS" handle sliding the view so textfields are not obscured?
    if so, does it reset the view before deciding if it needs to scroll/slide? Meaning if there are two textfields A is above B and both would be obscured.... if the user taps on B, enters some text, then taps on A does the screen slide again? or does it stay still because A is already visible?

    If Xojo does NOT handle it automagically..... what kind of code do you guys use.... I know that ObjC/Swift do not do it automagically, and I have seen code to do it there.... was wondering how this situation was handled within Xojo?

  2. Jeremie L

    Apr 13 Pre-Release Testers, XDC Speakers Europe (France)

    I always place text fields above the keyboard to not bother about this.

    But when it comes to text fields in a Table, I use a table extension from http://www.falcosoftware.com/xojo/

  3. Dave S

    Apr 13 San Diego, California USA

    @Jeremie L I always place text fields above the keyboard to not bother about this./

    So you compromise the UI layout?

    I was wondering how others would solve the problem in Xojo.... I have a screen layout in mind that (and needs) 20 Textfields... and the layout stretches from the very top to the very bottom of an iPhone screen...so when the user wants to enter something in an upper textfield.... the keyboard just appears, and the view stays still.... but if they tap a bottom field, the whole view would need to slide up, and then only as much as the keyboard height (which of course varies, by type and device)

    Personally I think this functionality should be built into to iOS so the developer never needs to care... .but alas it is not.

  4. Jeremie L

    Apr 13 Pre-Release Testers, XDC Speakers Europe (France)

    @Dave S So you compromise the UI layout?

    Of course not, I find fantastic ways of working around this issue to improve the UI/UX and deliver the best experience to my 200k+ users.

  5. Dave S

    Apr 13 San Diego, California USA

    Sorry I asked

  6. Douglas H

    Apr 13 Pre-Release Testers

    @Dave S Personally I think this functionality should be built into to iOS so the developer never needs to care... .but alas it is not.

    I can't speak for Xojo for iOS because I have not used it yet. Most all my iOS apps are currently done in another product where it is handled for me automagically *if* do it a certain way.

    If I just define a window and place text fields on that window, they get overlaid by the virtual keyboard.

    However, if I place the text fields in what is called a "Scroll View" and that scroll view either covers the whole window or at least enough area above the virtual keyboard area, then setting the focus into a field (either by the user tapping a field, or via code) when the keyboard appears it scrolls the text field to where it is visible. I don't add any code to make that happen.

    To answer your original question, if the user had tapped into field B and the contents needed to scroll and then tapped into field A and it was already visible, then contents does not scroll again. In other words, in my experience if a field is already visible the contents does not move. If not, it scrolls the necessary amount to put that field above the virtual keyboard (and toolbar, if any).

    But perhaps it is not iOS doing that -- I always assumed it was.

    But to make that happen in the product I use, I need to place the UI controls like text fields in a so called "Scroll View". I don't know if Xojo has an equivalent. But think of it as a container control or canvas that scrolls.

    Doug

or Sign Up to reply!