iOS上的XE4 Firemonkey可防止睡眠模式 [英] XE4 Firemonkey on iOS prevent sleep mode

查看:248
本文介绍了iOS上的XE4 Firemonkey可防止睡眠模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为适用于iOS的Firemonkey XE4开发应用程序,并且在没有用户输入时需要防止设备进入休眠状态。我发现这个命令用于xcode开发:

I am developing an app in Firemonkey XE4 for iOS and need to prevent the device from sleeping when there is no user input. I have found this command for xcode development:

[应用程序setIdleTimerDisabled:YES];

[application setIdleTimerDisabled:YES];

我假设有一个等价的FMX?

I presume there is an equivalent in FMX?

有人可以帮忙吗?

谢谢

Darryl

推荐答案

您可以直接进入UIApplication,如下所示:

You can go straight to UIApplication, as so:

uses
  iOSapi.UIKit;

{$R *.fmx}

procedure TForm6.Button1Click(Sender: TObject);
var
  UIApp : UIApplication;
begin
  UIApp := TUIApplication.Wrap(TUIApplication.OCClass.sharedApplication);
  UIApp.setIdleTimerDisabled(True);
end;

这篇关于iOS上的XE4 Firemonkey可防止睡眠模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆