【发布时间】:2013-11-06 12:06:25
【问题描述】:
我有一个可以在 iPhone 和 iPad 上运行的应用程序。我在我的一个 ViewController 中设置了一个 UIBarButton 项,但由于某种原因,它显示在 iPhone 上而不是 iPad(模拟器或真实设备)上。
我正在使用以下代码来获取 iPhone 和 iPad 的按钮图像(这是系统按钮图像)"
UIBarButtonItem *showButtonButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh target:self action:@selector(loadButtonVC)];
self.navigationItem.leftBarButtonItem = showButtonButton;
我很茫然。两台设备都运行 iOS 7,并且该应用程序仅针对 iOS 7。但图像没有显示在 iPad 上,按钮在那里,因为它仍然响应按下它。
【问题讨论】:
-
您在一个全新的通用项目中的代码在 iPhone/iPad 上都非常有效。您确定 iPad 上的控制器嵌入在导航控制器中吗?
-
是的,它肯定嵌入在 NavigationController 中,它是 Root ViewController。我可以在情节提要中设置按钮并且它可以工作。这对我有用。还是谢谢。
标签: ios iphone objective-c ipad ios7