在某一些 Android 的机子上,点入 Edit 显示会键盘,但关闭键盘再点一次 Edit 后,键盘并不会再次显示出来。

实机测试:

  Sony Xperia ST17i:无法再次显示。

  Nexus 7 II:可以正常显示。

解决方案:在点入 Edit 事件,显示键盘。

源码下载:[原创]示例Edit关闭键盘再显示.zip

function ShowVirtualKeyboard(const AControl: TFmxObject): Boolean;
var Service1: IFMXVirtualKeyboardService;
begin
     if TPlatformServices.Current.SupportsPlatformService(IFMXVirtualKeyboardService, IInterface(Service1)) then
          Result := Service1.ShowVirtualKeyboard(AControl)
     else Result := False;
end;

procedure TForm1.Edit1Click(Sender: TObject);
begin
     ShowVirtualKeyboard(TFmxObject(Sender));
end;

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-24
  • 2022-12-23
  • 2022-12-23
  • 2021-12-28
  • 2022-12-23
猜你喜欢
  • 2021-10-08
  • 2021-12-15
  • 2021-12-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-15
相关资源
相似解决方案