Keep Controls Visible When Virtual Keyboard Pops Up In Firemonkey On Android And IOS

Virtual Keyboard Control Focus Delphi XE5 FiremonkeyIf you’re building any kind of Delphi XE5 Firemonkey mobile app that has input controls you have probably run into the problem of the virtual keyboard hiding the edit controls underneath itself. There are a few different solutions to this problem but some of the best ones support the multiline TMemo as well. I believe all of the solutions work cross platform in Delphi XE5 Firemonkey for Android and IOS. You can find two solutions from David Nottage and Mike Sutton in this Embarcadero forum post from September 2013. David Nottage also wrote a blog post about his solution which comes with demo source code. David’s solution has been put into a component called TControlMover you can easily add to any of your projects. Here is a sample from his component:

There is a problem on IOS where the Bounds rectangle is reported incorrectly when in landscape mode. You can get the correct bounds rectangle using code found on this QC entry. Lastly, there is a ScrollableForm demo available from Embarcadero. Here is a sample of the source from the ScrollableForm demo:

Head over and get the full source to the TControlMover component and demo.

Have Delphi Firemonkey questions? Ask and get answers on StackOverflow.

Keep Controls Visible When Virtual Keyboard Pops Up In Firemonkey On Android And IOS by Delphi XE5 XE6 XE7 XE8 10 Seattle Berlin Tokyo Firemonkey, Delphi Android, Delphi IOS is licensed under a Creative Commons Attribution 4.0 International License.

8 Responses to Keep Controls Visible When Virtual Keyboard Pops Up In Firemonkey On Android And IOS

  1. Pingback: Ten Tips For Creating Professional Android Apps With Delphi XE5 Firemonkey | Delphi XE5 Firemonkey, Delphi Android, Delphi IOS

  2. Pingback: Polish Your Firemonkey Apps For IOS With These Twelve Tips | Firemonkey X

  3. Pingback: Ten Tips For Building Stunning Professional Android Apps With Delphi XE7 Firemonkey | Delphi XE5 XE6 XE7 Firemonkey, Delphi Android, Delphi IOS

  4. Pingback: Ten Tips For Building Professional Multi Platform Enterprise Apps With Delphi XE8 Firemonkey | Delphi XE5 XE6 XE7 XE8 Firemonkey, Delphi Android, Delphi IOS

  5. Harald says:

    I have some problems with the “ScrollableForm demo” on a form with TStatusBar.

    Now i am using a simple methode:
    – Set StatusBar.Height to Keyboard-Height
    – Scroll to Edit

    procedure TFormMain.FormVirtualKeyboardShown(Sender: TObject; KeyboardVisible: Boolean; const Bounds: TRect);
    var LItem: TListBoxItem;
    begin
    LItem := MyFindSelectedListBoxItem;
    if Assigned(LItem) then
    begin
    StatusBarMain.Height := Bounds.Height;
    if MyGetListBoxOfItem(LItem) is TListBox then
    with MyGetListBoxOfItem(LItem) as TListBox do
    begin
    FViewportPosition := ViewportPosition;
    ScrollToItem(LItem);
    end;
    end;
    end;

    procedure TFormOmAppMain.FormVirtualKeyboardHidden(Sender: TObject; KeyboardVisible: Boolean; const Bounds: TRect);
    begin
    StatusBarMain.Height := 22;
    ListBoxXX.ViewportPosition := FViewportPosition;
    end;

  6. Pingback: Keep Controls Visible When Virtual Keyboard Opens In Delphi XE8 Firemonkey On Android | Delphi XE5 XE6 XE7 XE8 Firemonkey, Delphi Android, Delphi IOS

  7. Pingback: [mobile OS] Virtuelle Tastatur verdeckt Controls - Delphi-PRAXiS

  8. Pingback: Keep Controls Visible When Virtual Keyboard Pops Up In Delphi 10.2 Tokyo On Android And IOS | Delphi XE5 XE6 XE7 XE8 10 Seattle Berlin Tokyo Firemonkey, Delphi Android, Delphi IOS

Leave a Reply

Show Buttons
Hide Buttons
Read previous post:
Free Word Game With Source Code For Delphi XE5 Firemonkey On Android And IOS

Roman Yankovsky has published a word game built with Delphi XE5 Firemonkey for Android to the Google Play store. The...

Close