Want to use muliple nibs for different iphone interface orientations

前端 未结 4 544
自闭症患者
自闭症患者 2020-12-20 22:57

I have a situation, I have created two different nibs, one in Portrait Mode and other in Landscape mode. I had lots of designs in the view so, i had to opt for two different

4条回答
  •  猫巷女王i
    2020-12-20 23:23

    shouldAutorotateToInterfaceOrientation: should simply return with a YES or a NO. In my experience, its not a good idea to do any extended processing here. From the docs:

    Your implementation of this method should simply return YES or NO based on the value in the interfaceOrientation parameter. Do not attempt to get the value of the interfaceOrientation property or check the orientation value reported by the UIDevice class. Your view controller is either capable of supporting a given orientation or it is not.

    A better place to load your nibs in response to a device rotation would be

    willRotateToInterfaceOrientation:duration: or didRotateToInterfaceOrientation:

提交回复
热议问题