Handling autorotation for one view controller in iOS7

前端 未结 5 1446
野趣味
野趣味 2020-12-06 02:37

I\'ve read many answers on SO but I can\'t seem to get autorotation working on iOS7.

I only need one view controller to rotate, so I don\'t want to set rotation sett

5条回答
  •  無奈伤痛
    2020-12-06 03:07

    I've faced such problem - had only one landscape view in my app. I've used below code to to handle that.

    #import "objc/message.h"
    -(void)viewWillAppear:(BOOL)animated{
    
    objc_msgSend([UIDevice currentDevice], @selector(setOrientation:), UIInterfaceOrientationLandscapeLeft);
    }
    

提交回复
热议问题