ios - iOS 7 上的 UIBarButtonSystemItemRefresh

标签 ios iphone objective-c ipad ios7

我有一个应用程序可以在 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/

相关文章:

ios - 如何在右侧显示助理编辑器

iphone - 从仅窗口模板创建应用程序时我缺少什么?

ios - 2.10 iPhone 应用程序也必须在 iPad 上运行,无需修改,iPhone 分辨率和 2X iPhone 3GS 分辨率

iphone - 检查 objective-c 枚举是否存在

ios - 在 Web View 中生成 PDF 时,如何先将 PDF 数据写入文件

ios - 为什么我不能从另一个类访问我的 UIView 的类属性?

ios - 使用 PKRevealController 滑动导航

iphone - 邀请 Twitter 好友获取应用

ios - 在 iOS 中采用 MVVM : ViewModel responsibilities?

ios - swift 3 : replace c style for-loop with float increment