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

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);

原文地址:https://www.cnblogs.com/lantianhf/p/4349937.html