0
欲用户通知某些事件被触发,这样我使用亮度 [UIScreen mainScreen] .brightness = 1.0 // 0.0替代地
它是工作正常,当应用在前台模式,但 当应用程序是后台模式,并在那个时候触发该事件我的代码不起作用。 我使用了位置,所以我的应用程序能够在后台运行。变化的ios5装置亮度时在后台模式应用
给我建议当应用程序处于后台模式时如何设置亮度。
欲用户通知某些事件被触发,这样我使用亮度 [UIScreen mainScreen] .brightness = 1.0 // 0.0替代地
它是工作正常,当应用在前台模式,但 当应用程序是后台模式,并在那个时候触发该事件我的代码不起作用。 我使用了位置,所以我的应用程序能够在后台运行。变化的ios5装置亮度时在后台模式应用
给我建议当应用程序处于后台模式时如何设置亮度。
- (void)applicationDidEnterBackground:(UIApplication *)application
{
// UIBackgroundTaskIdentifier *bgTask = nil;
UIApplication *app = [UIApplication sharedApplication];
counterTask = [[UIApplication sharedApplication]
beginBackgroundTaskWithExpirationHandler:^{
[app endBackgroundTask:counterTask];
counterTask = UIBackgroundTaskInvalid;
// If you're worried about exceeding 10 minutes, handle it here
theTimer=[NSTimer scheduledTimerWithTimeInterval:20
target:self
selector:@selector(YourFunction)
userInfo:nil
repeats:YES];
}];
count=0;
theTimer=[NSTimer scheduledTimerWithTimeInterval:20
target:self
selector:@selector(YourFunction)
userInfo:nil
repeats:YES];
//[super viewDidLoad];
}