2015-04-14 22 views
3

我使用這個結果的UIBarButtonItem:「完成」 UINavigationBarButtonItem切斷

enter image description here

我使用此代碼,將其添加到導航

self.doneButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(dismissWebViewController:)]; 
[self.navigationItem setRightBarButtonItem:self.doneButton]; 

我在做什麼錯了?

+0

您是否嘗試在導航欄中拖放UIBarButton項目,稍後設置其值。 – Mahi

回答

0

看起來你的導航欄比你的屏幕大。看看你的故事板。選擇導航欄,您必須在元素的開頭和結尾處看到方形。如果不是,請將其移至適合屏幕的位置。

作爲參考,iphone 6 4.7英寸應用程序的導航欄是375寬度。

另外,檢查是否正確設置了約束條件。檢查你的導航欄有「間距到最近的鄰居」,頂部爲0,左側和右側爲-16。