-2

为了强制改变设备方向,我从这里获取代码

但苹果可以拒绝使用的应用程序setOrientation:吗?有一些经验吗?

或者可能有人有100%的工作并且不能被Apple拒绝,解决方案?

if (UIDeviceOrientationIsLandscape([[UIDevice currentDevice] orientation])) {
        if ([[UIDevice currentDevice] respondsToSelector:@selector(setOrientation:)]) {
            int orientationPortrait = UIInterfaceOrientationPortrait;
            NSMethodSignature *sig = [[UIDevice currentDevice] methodSignatureForSelector:@selector(setOrientation:)];
            NSInvocation* invo = [NSInvocation invocationWithMethodSignature:sig];
            [invo setTarget:[UIDevice currentDevice]];
            [invo setSelector:@selector(setOrientation:)];
            [invo setArgument:&orientationPortrait atIndex:2];
            [invo invoke];
        }
    }

好的,谢谢,我会试试这个片段。

4

1 回答 1

1

NO,苹果会以强制导向为由拒绝。有时这是在横向/纵向中查看的要求和唯一方法。苹果不会拒绝

于 2014-03-20T11:40:50.843 回答