Prevent AlertView from auto rotating

后端 未结 3 380
长情又很酷
长情又很酷 2021-01-20 05:38

The launch page of my app is set to portrait only with this little bit of code:

- (NSUInteger)supportedInterfaceOrientations
{
    return UIInterfac         


        
3条回答
  •  被撕碎了的回忆
    2021-01-20 05:56

    Have you try with implementing shouldAutorotate ? You can do in your case :

    - (BOOL)shouldAutorotate
    {
        if (UIInterfaceOrientationIsLandscape([[UIDevice currentDevice] orientation])) return NO;
        else return YES;
    }
    

提交回复
热议问题