开发者

How to detect orientation in costomNavigationbar?

i need to draw PortraitImage or LandscapeImage when my costomNavigati开发者_StackOverflowon has been change to portrait or landscape.


You need to override willRotateToInterfaceOrientation:duration: in your UIViewController. This will give you a call every time the app changes its orientation.


You can detect orientation by using the UIDevice Class, as shown here:

http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIDevice_Class/Reference/UIDevice.html#//apple_ref/occ/instp/UIDevice/orientation

You need to use the methods

- (void)beginGeneratingDeviceOrientationNotifications  

and

- (void)endGeneratingDeviceOrientationNotifications  

That should probably work.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜