方向问题:
1.appdelegate里面添加:
//iOS6 才会调用
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
return (UIInterfaceOrientationMaskAll);
}
2.相应的controller里面添加:
//iOS6
- (BOOL)shouldAutorotate{
return YES;
}
- (NSUInteger)supportedInterfaceOrientations {
if (self.bookModel.bookOrientation == BookOrientationLandscape) {
return UIInterfaceOrientationMaskLandscape;
}
else {
return UIInterfaceOrientationMaskPortraitUpsideDown|UIInterfaceOrientationMaskPortrait;
}
}
//iOS5
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation{
if (self.bookModel.bookOrientation == BookOrientationLandscape) {
return UIInterfaceOrientationIsLandscape(toInterfaceOrientation);
}
else {
return UIInterfaceOrientationIsPortrait(toInterfaceOrientation);
}
}
3.plist里面添加相应的方向支持.
注意:ios6里面appdelegate里面要添加方向支持才可以.