首页 > 其他 > 详细

UIScreen

时间:2015-08-31 11:59:02      阅读:111      评论:0      收藏:0      [点我收藏+]

UIScreen 对象定义了与硬件显示的相关属性,IOS设备有一个主屏幕,0个或是多个附加屏幕,用这个类来获取附加到设备屏幕的对象,每个Screen对象都定义了矩形边界和一些其他有趣的属性brightness。

处理通知

  • - (void)handleScreenConnectNotification:(NSNotification*)aNotification {

  •    UIScreen*    newScreen = [aNotification object];

  •    CGRect        screenBounds = newScreen.bounds;

  •    if (!_secondWindow) {

  •        _secondWindow = [[UIWindow alloc] initWithFrame:screenBounds];

  •        _secondWindow.screen = newScreen;

  •        // Set the initial UI for the window and show it.

  •        [self.viewController displaySelectionInSecondaryWindow:_secondWindow];

  •        [_secondWindow makeKeyAndVisible];

  •    }

  • }

  • - (void)handleScreenDisconnectNotification:(NSNotification*)aNotification {

  •    if (_secondWindow) {

  •        // Hide and then delete the window.

  •        _secondWindow.hidden = YES;

  •        [_secondWindow release];

  •        _secondWindow = nil;

  •        // Update the main screen based on what is showing here.

  •        [self.viewController displaySelectionOnMainScreen];

  •    }

  • }




UIScreen

原文:http://my.oschina.net/u/1536972/blog/499392

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!