XE4 Firemonkey on iOS prevent sleep mode

蓝咒 提交于 2019-12-06 08:19:38

问题


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:

[application setIdleTimerDisabled:YES];

I presume there is an equivalent in FMX?

Can anyone help please?

Thanks

Darryl


回答1:


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;


来源:https://stackoverflow.com/questions/16526110/xe4-firemonkey-on-ios-prevent-sleep-mode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!