OGeek|极客世界-中国程序员成长平台

标题: ios - iOS 7 上的 UIBarButtonSystemItemRefresh [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-12 16:09
标题: ios - iOS 7 上的 UIBarButtonSystemItemRefresh

我有一个可以在 iPhone 和 iPad 上运行的应用程序。我在我的一个 ViewController 中设置了一个 UIBarButton 项,但由于某种原因,它显示在 iPhone 上而不是 iPad(模拟器或真实设备)上。

我正在使用以下代码来获取 iPhone 和 iPad 的按钮图像(这是系统按钮图像)"

UIBarButtonItem *showButtonButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh target:self actionselector(loadButtonVC)];
self.navigationItem.leftBarButtonItem = showButtonButton;

我很茫然。两台设备都运行 iOS 7,并且该应用程序仅针对 iOS 7。但图像没有显示在 iPad 上,按钮在那里,因为它仍然响应按下它。



Best Answer-推荐答案


使用此代码

UIBarButtonItem *refreshBtn = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh target:self
                                   actionselector(loadButtonVC)];
    self.navigationController.navigationBar.topItem. leftBarButtonItem = refreshBtn;

关于ios - iOS 7 上的 UIBarButtonSystemItemRefresh,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19811700/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://sqlite.in/) Powered by Discuz! X3.4