版權聲明:本文為博主原創(chuàng)文章搬味,未經博主允許不得轉載麦撵。轉載請注明轉至Z.MJun的簡書
- (void)setBackButtonTitlePositionAdjustment:(UIOffset)adjustment forBarMetrics:(UIBarMetrics)barMetrics
使用這個方法的時候來調整 UINavigationBar 的返回按鍵的標題位置勺三。
如果想把UINavigationBar上返回按鈕的文字隱藏
正確的做法
設置按鈕的字體和顏色來隱藏。
<pre><code>UIBarButtonItem *item = [UIBarButtonItem appearance];
NSDictionary *attributes = @{NSFontAttributeName:[UIFont systemFontOfSize:0.001],
NSForegroundColorAttributeName:[UIColor clearColor]};
[item setTitleTextAttributes:attributes forState:UIControlStateNormal];</code></pre>
網絡上握玛,錯誤的做法
<pre><code>adjustment = UIOffsetMake(NSIntegerMin, NSIntegerMin)</code></pre>
這個會導致其他應用調轉入應用時候的閃屏問題绒尊。如果分享應用后畜挥,返回應用就會閃屏。