所以在我的主窗口中,我有這兩個按鈕「設置」中的一個(leftBarButtonItem)&「I」(信息按鈕,rightBarButtonItem)」UINavigationItem - 沒有「免費」後退按鈕爲我的按鈕
當我按下信息按鈕,我得到了「自由」後退按鈕,但我有以編程的設置按鈕,創建一個?這是爲什麼?
這裏是我編程的按鈕viewDidLoad中
UIBarButtonItem *settingsBarButtonItem =[[UIBarButtonItem alloc]initWithTitle:@"Settings" style:UIBarButtonItemStyleBordered target:self action:@selector(settings:)];
self.navigationItem.leftBarButtonItem = settingsBarButtonItem;
UIButton* infoButton = [UIButton buttonWithType:UIButtonTypeInfoLight];
CGRect frame = infoButton.frame;
frame.size.width = 40.0f;
infoButton.frame = frame;
[infoButton addTarget:self action:@selector(about:) forControlEvents:UIControlEventTouchUpInside];
butInfo = [[UIBarButtonItem alloc] initWithCustomView:infoButton];
self.navigationItem.rightBarButtonItem = butInfo;