您的位置:首页 > 移动开发 > IOS开发

IOS横屏事件

2015-10-10 13:05 288 查看
[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];

[[NSNotificationCenter defaultCenter] addObserver:self

selector:@selector(deviceOrientationDidChange:)

name:UIDeviceOrientationDidChangeNotification

object:nil];

-(void)deviceOrientationDidChange:(NSObject*)sender{

UIDevice* device = [sender valueForKey:@"object"];

NSLog(@"%d",device.orientation);

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: