我有一个应用程序可以在 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 上显示,按钮在那里,因为它仍然响应按下它。
最佳答案
使用此代码
UIBarButtonItem *refreshBtn = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh target:self
action:@selector(loadButtonVC)];
self.navigationController.navigationBar.topItem. leftBarButtonItem = refreshBtn;
关于ios - iOS 7 上的 UIBarButtonSystemItemRefresh,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19811700/