2010-06-10 76 views
1

alt text需要有關添加navigationItem

正如你在圖像看,當導航控制器推

如果我嘗試創建一個像這樣就會出現像底部的圖片會自動創建開頭的圖片。

如何以編程方式創建像頂部圖片一樣的後退按鈕?

這裏是我的代碼來創建完成按鈕

self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(backtohome)]; 

回答

0
UIBarButtonItem *theBackButton = [[UIBarButtonItem alloc] initWithTitle:@"Done" 
                    style:UIBarButtonItemStylePlain target:self action:nil]; 
self.navigationItem.backBarButtonItem = theBackButton; 
[theBackButton release];