firemonkey 去掉ios 虚拟键盘上的‘done’toolbar

BY:乖鸟

 

这个ios 虚拟键盘上的‘done’toolbar 简直太丑了,不过可以在这个toolbar上自己增加按钮,和功能,这倒不错~~~,

首先uses: FMX.VirtualKeyboard  和 FMX.Platform

在 form的  private 中加入变量:

    FService: IFMXVirtualKeyboardToolbarService;

然后在FormCreate 中加入:

if TPlatformServices.Current.SupportsPlatformService(IFMXVirtualKeyboardToolbarService, IInterface(FService)) then
begin
  showmessage('搞定啦!!');
end
else
begin
  showmessage('还没搞定呢!!!!');
end;
这一句应该是 给FService一个实例指针。不加这一句,FService是nil ,是空的。

这样后 IFMXVirtualKeyboardToolbarService 中的方法,FService就可以使用了,包括增加按钮等等。

下面这一句就可以去掉这个丑陋的工具条了:
if Assigned(FService) then
    FService.SetToolbarEnabled(false);

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-26
  • 2021-08-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-16
  • 2021-12-08
  • 2022-12-23
  • 2021-10-05
  • 2021-12-31
  • 2022-12-23
相关资源
相似解决方案