objective-c - iOS夜间模式实现原理
ringa_lee
ringa_lee 2017-04-28 09:06:27
0
1
464
  1. 描述你的问题
    iOS 夜间模式 实现原理

  2. 贴上相关代码

 -(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
        
        self.window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds];
        self.window.backgroundColor = [UIColor whiteColor];
        [self.window makeKeyAndVisible];
        ViewController *rootVC = [[ViewController alloc]init];
        UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:rootVC];
        UIView *view = [[UIView alloc]init];
        view.backgroundColor = [UIColor grayColor];
        view.alpha = 0.4;
        view.userInteractionEnabled = NO;
        [nav.view addSubview:view];
        [view mas_makeConstraints:^(MASConstraintMaker *make) {
            make.edges.mas_equalTo(nav.view);
        }];
        
        self.window.rootViewController = nav;
        
        return YES;

}
  1. 贴上报错信息
    以上方法为什么实现不了。。。求真相。。

  2. 贴上相关截图

  3. 已经尝试过哪些方法仍然没解决(附上相关链接)

ringa_lee
ringa_lee

ringa_lee

reply all(1)
小葫芦

To enable night mode on and off through singleton mode, refer to the principle of this article http://www.jianshu.com/p/a38850421c56

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template