沒有空間我有一個UIViewController
設置在右側顯示一個信息按鈕在其UINavigationItem
這樣的:rightBarButtonItem信息按鈕,右邊
UIButton *infoButton = [UIButton buttonWithType:UIButtonTypeInfoLight];
[infoButton addTarget:self action:@selector(toggleAboutView) forControlEvents:UIControlEventTouchUpInside];
self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithCustomView:infoButton] autorelease];
完美的作品,但唯一的問題是,我留下了很少或幾乎沒有空間到按鈕的右側,看起來很醜陋:
有什麼辦法使按鈕出從右側移動約5像素?
謝謝。
它看起來適合我。看看在導航欄右側放置一個按鈕的其他iPhone應用程序:消息,日曆,聯繫人,地圖等等,它們都以相同的方式間隔。 – 2010-09-11 19:32:40
我的客戶希望它更遠,並且這個間距用信息按鈕看起來不太好。 – Emil 2010-09-11 19:50:08
我在導航欄上使用相同的按鈕,但在左側而不是在右側,使用默認間距。我看起來很好。如果您的客戶想要更多地突出顯示,請問爲什麼他們希望自己的應用看起來與使用導航欄中的信息按鈕的所有其他應用完全不同。 – 2010-09-11 23:55:03