cari

Rumah  >  Soal Jawab  >  teks badan

objective-c - iOS夜间模式实现原理

  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_leeringa_lee2762 hari yang lalu457

membalas semua(1)saya akan balas

  • 高洛峰

    高洛峰2017-04-28 09:08:27

    Dayakan mod malam hidup dan mati melalui mod tunggal, rujuk prinsip artikel ini http://www.jianshu.com/p/a38850421c56

    balas
    0
  • Batalbalas