How do I force a specific UIInterfaceOrientation on an individual view in a UINavigationController?

后端 未结 8 901
闹比i
闹比i 2020-12-14 17:27

Okay, so here\'s the situation:

I have an app in which I only want ONE specific view in a UINavigationController to have a landscape orientation. This view is a UIIm

8条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-14 18:21

    This might be what your looking for.

    // Rotates the view.
    CGAffineTransform transform = CGAffineTransformMakeRotation(3.14159/2);
    self.view.transform = transform;
    
    // Repositions and resizes the view.
    CGRect contentRect = CGRectMake(-80, 80, 480, 320);
    self.view.bounds = contentRect;
    

    from http://www.iphonedevsdk.com/forum/iphone-sdk-development/1394-landscape-uiviewcontroller-uiview-rotation.html

提交回复
热议问题