菜鸟教程小白 发表于 2022-12-12 16:09:42

ios - iOS 7 上的 UIBarButtonSystemItemRefresh


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

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

<pre><code>UIBarButtonItem *showButtonButton = [ initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh target:self action:@selector(loadButtonVC)];
self.navigationItem.leftBarButtonItem = showButtonButton;
</code></pre>

<p>我很茫然。两台设备都运行 iOS 7,并且该应用程序仅针对 iOS 7。但图像没有显示在 iPad 上,按钮在那里,因为它仍然响应按下它。</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>使用此代码</p>

<pre><code>UIBarButtonItem *refreshBtn = [ initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh target:self
                                 action:@selector(loadButtonVC)];
    self.navigationController.navigationBar.topItem. leftBarButtonItem = refreshBtn;
</code></pre></p>
                                   
                                                <p style="font-size: 20px;">关于ios - iOS 7 上的 UIBarButtonSystemItemRefresh,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/19811700/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/19811700/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - iOS 7 上的 UIBarButtonSystemItemRefresh