我使用的Xcode 4.5.1和使用條件我想我appliaction只在橫向的IOS(不論是iOS 5和iOS 6)
#define IOS_OLDER_THAN_6 ([ [ [ UIDevice currentDevice ] systemVersion ] floatValue ] < 6.0)
#define IOS_NEWER_OR_EQUAL_TO_6 ([ [ [ UIDevice currentDevice ] systemVersion ] floatValue ] >= 6.0)
#ifdef IOS_OLDER_THAN_6
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation{
[image_signature setImage:[self resizeImage:image_signature.image]];
return (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft);
}
#endif
#ifdef IOS_NEWER_OR_EQUAL_TO_6
-(BOOL)shouldAutorotate {
return YES;
}
- (NSUInteger)supportedInterfaceOrientations {
[image_signature setImage:[self resizeImage:image_signature.image]];
return UIInterfaceOrientationMaskLandscapeLeft;
}
#endif
我加入信息的關鍵。 plist中。
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
</array>
,並設置支持接口方向
,如果我有添加鍵值中的info.plist,並設置支持方向,並且沒有使用下面的代碼,應用程序不是在內部監督辦公室工作5.0
此代碼是工作,但我想用小替代概念....請幫助我..
在此先感謝!
您是否嘗試過只設定一個方向在你的info.plist(目標概要)? –
我嘗試了...但沒有解決方案 – Deepesh
這些宏的使用完全不正確...... – brigadir