首页 新闻 会员 周边

ios 打开unity时旋转屏幕

0
[已关闭问题] 关闭于 2018-11-07 16:29

当用ios 程序打开unity的图形时,我旋转之后再退出时 最上面的导航栏没了 我的旋转是这样写的

- (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
    [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationNone];
 
    [[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationNone];
 
    if (self.allowLandscapeRight) {
        return UIInterfaceOrientationMaskLandscapeRight;
    }
 
    return UIInterfaceOrientationMaskPortrait;
}
 
//强制旋转成全屏
    NSNumber *value = [NSNumber numberWithInt:UIDeviceOrientationLandscapeLeft];
    [[UIDevice currentDevice]setValue:value forKey:@"orientation"];
//旋转回来
NSNumber *value = [NSNumber numberWithInt:UIDeviceOrientationPortrait];
    [[UIDevice currentDevice]setValue:value forKey:@"orientation"];
1137651677的主页 1137651677 | 菜鸟二级 | 园豆:218
提问于:2018-01-04 14:11
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册