简体   繁体   中英

How is ShowVirtualKeyboard run on the Delphi FireMonkey Android platform?

Consider:

Uses FMX.VirtualKeyboard, FMX.Platform;

procedure TForm1.Button1Click(Sender: TObject);
    var Keyboard: IFMXVirtualKeyboardService;
    begin
        keyboard := TPlatformServices.Current.GetPlatformService(IFMXVirtualKeyboardService) as IFMXVirtualKeyboardService;
        if  TVirtualKeyboardState.Visible in keyboard.VirtualKeyBoardState then
        begin
            Keyboard.HideVirtualKeyboard;
        end;
    end;

HideVirtualKeyboard is running with this code, but how is ShowVirtualKeyboard run on the Delphi FireMonkey Android platform?

Because for the same code, ShowVirtualKeyboard is giving:

not enough actual parameters error in code page

The ShowVirtualKeyboard method expects to receive one parameter indicating which control the keyboard will type into. For example, to show the keyboard for typing into a memo control:

procedure TForm1.Button1Click(Sender: TObject);
begin
  keyboard := TPlatformServices.Current.GetPlatformService(IFMXVirtualKeyboardService) as IFMXVirtualKeyboardService;
  keyboard.showVirtualKeyboard(memo1);
end;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM