【发布时间】:2014-02-07 12:13:12
【问题描述】:
在 iOS 7 中,我在 UINavigationController 的导航栏中显示了 UIBarButtonItem。 UIBarButtonItem 有一个用于纵向的图像和另一个用于横向的图像:
// "self" refers to the UINavigationController
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithImage:portraitImage landscapeImagePhone:landscapeImage style:UIBarButtonItemStylePlain target:nil action:NULL];
如果您只是旋转界面,则会使用正确的图像作为界面方向。但是,如果 UINavigationController 的视图首先以横向显示(例如,通过以横向显示或通过关闭以横向覆盖它的视图控制器),则使用 portrait 图像反而!为什么会这样?这是一个框架错误吗?如果是这样,有没有办法解决这个问题,所以横向图像将始终以横向显示?
【问题讨论】:
-
你是在 ipad 上测试吗?
标签: ios7 uinavigationcontroller uinavigationbar uibarbuttonitem landscape