簡單修復:
創建一個視圖與標籤並設置視圖作爲標題視圖到導航控制器
// creating title view
UIView *titleView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 200, 40)];
// Adding label with custom frame
UILabel *labelForTitle = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 200, 30)];
[labelForTitle setCenter:titleView.center];
[labelForTitle setText:@"sfdfagd ggjhdgfjhadsgfjasgdhfgasdjfgajsdgfjashgdjhfasjdfsadjgfhsadghf"];
[titleView addSubview:labelForTitle];
// setting title view for the navigation controller.
[self.navigationItem setTitleView:titleView];
輸出將是這樣的:
imho - 沒關係,並試圖相信蘋果關於用戶體驗的決定。如果後退按鈕沒有任何屬性 - 嘗試使用自定義後退按鈕看起來與默認相同。 –
'[[UIBarButtonItem alloc] initWithCustomView:yourView]' –