iphone 方向旋转

来源:互联网 发布:欧洲海关数据 编辑:程序博客网 时间:2024/06/05 02:18

在应用中从竖屏模式强制转换为横屏模式

http://www.cocoachina.com/iphonedev/sdk/2010/1130/2410.html

UIInterfaceOrientation和UIDeviceOrientation的区别

http://bukkake.iteye.com/blog/979515


根据旋转来调整布局

- (id)init{if ((self = [self initWithNibName:nil bundle:nil])) {[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_3_2if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {#endifif (![UIDevice currentDevice].generatesDeviceOrientationNotifications) {[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];[self setDidEnableRotationNotifications:YES];}[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(orientationChanged:) name:UIDeviceOrientationDidChangeNotification object:nil];#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_3_2}#endif}return self;}- (void)dealloc{if ([self didEnableRotationNotifications]) {[[NSNotificationCenter defaultCenter] removeObserver:self name:UIDeviceOrientationDidChangeNotification object:nil];}[[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillShowNotification object:nil];[request release];[tableView release];[presentingController.view removeFromSuperview];[presentingController release];[super dealloc];}


原创粉丝点击