ios - 在导航项中隐藏返回文本
<p><p>我需要通过替换导航栏中的后退文本(按钮)来设置后退箭头。我可以查看后退箭头,但我不知道如何在导航项中隐藏后退文本。这是我的代码:</p>
<p>因此收到警告: : CGImageCreateWithImageProvider: invalid image size: 0 x 0.</p>
<pre><code>(void)viewWillAppear:(BOOL)animated
{
UIImage *backButtonHomeImage = [ resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 104, 13)];
[ setBackButtonBackgroundImage:backButtonHomeImageforState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
self.navigationItem.leftBarButtonItem = nil;
}
</code></pre></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>答案</p>
<pre><code> -(void)viewWillAppear:(BOOL)animated
{
;
if( != self)
{
UIButton *backButton = [ initWithFrame:CGRectMake(0, 0, 26, 26)];
forState:UIControlStateNormal];
;
;
UIBarButtonItem *barBackItem = [ initWithCustomView:backButton];
self.navigationItem.hidesBackButton = TRUE;
self.navigationItem.leftBarButtonItem = barBackItem;
}
}
-(void)popViewControllerWithAnimation
{
;
}
</code></pre>
<p>可能会有所帮助。</p></p>
<p style="font-size: 20px;">关于ios - 在导航项中隐藏返回文本,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/20216723/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/20216723/
</a>
</p>
页:
[1]