2

我有一个可以在 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 上,按钮在那里,因为它仍然响应按下它。

4

1 回答 1

1

使用此代码

UIBarButtonItem *refreshBtn = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh target:self
                                   action:@selector(loadButtonVC)];
    self.navigationController.navigationBar.topItem. leftBarButtonItem = refreshBtn;
于 2013-11-06T13:05:40.050 回答