0

我正在尝试使用 applicationDidBecomeActive 方法(和类似的方法) - 我可以在 ObjC 中找到很多示例,但在 Monotouch 中没有。已在 AppDelegate 和 UIViewController 中尝试过覆盖,但编译器找不到合适的覆盖方法。那么,我该如何使用它呢?我想使用它(与计时器和 IdleTimerDisabled 结合使用)来阻止设备比平时更长时间地进入睡眠状态(它是一个秒表类型的应用程序)。也许我走错了路。

4

1 回答 1

2

在继承自 的应用程序委托中UIApplicationDelegate,您可以覆盖这些:

/// <summary>
/// Gets called by iOS if the app is started from scratch and is not resumed from background.
/// We have 17 seconds to leave this methos before iOS will kill the app.
/// </summary>
public override bool FinishedLaunching ( UIApplication application, NSDictionary launchOptions )

/// <summary>
/// Called if the app comes back from background or gets started. Triggered after FinishedLaunching().
/// </summary>
public override void OnActivated ( UIApplication application )

/// <summary>
/// Called if the application gets pushed to the background because the user hits the home button.
/// </summary>
public override void DidEnterBackground ( UIApplication application )

/// <summary>
/// Gets called if the app is resumed from background but NOT if the app starts first time.
/// </summary>
public override void WillEnterForeground ( UIApplication application )
于 2012-08-23T20:42:44.087 回答