Detect if app is running in Slide Over or Split View mode in iOS 9

后端 未结 15 2431
死守一世寂寞
死守一世寂寞 2020-12-04 15:31

In iOS 9, is it possible to detect when an app is running in iOS 9\'s Slide Over or Split View mode?

I\'ve tried reading through Apple\'s documentation on iOS 9 mult

15条回答
  •  南方客
    南方客 (楼主)
    2020-12-04 16:00

    Trying [UIScreen mainScreen].bounds, self.window.screen.bounds, self.window.frame, UIApplication.sharedApplication.keyWindow.frame and so on, the only working solution was deprecated method

    CGRect frame = [UIScreen mainScreen].applicationFrame;
    

    Which I fixed this way

    CGRect frame = [UIScreen mainScreen].applicationFrame;
    frame = CGRectMake(0, 0, frame.size.width + frame.origin.x, frame.size.height + frame.origin.y);
    self.window.frame = frame;
    

提交回复
热议问题