我是IOS开发中的新手,这是我第一个在iPad和iPhone上处理不同方向的应用程序..
这是场景, 我实现这个功能来处理方向,它对我来说很好。
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
但是当我去另一个页面并改变方向(例如:风景)然后再次回到第一页(例如:仍处于横向模式)时,UIImage的背景不再改变..
我真的很感激任何答案,谢谢
答案 0 :(得分:0)
(NSInteger)supportedInterfaceOrientations { [self performSelector:@selector(setImageFrame)];
返回UIInterfaceOrientationMaskAll; }
(BOOL)shouldAutorotate { [self performSelector:@selector(setImageFrame)];
返回YES; }
(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation { [self performSelector:@selector(setImageFrame)];
返回YES; }
或者只是检查autorisizing掩码,如果使用xib或设置all like lbltitle.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleWidth ....