我知道這是可能使用這一個導航項目添加自定義按鈕:在一個UINavigationController的在每個導航項目設置按鈕
UIButton *infoButton = [UIButton buttonWithType:UIButtonTypeInfoLight];
[infoButton addTarget:self
action:@selector(showInfo:)
forControlEvents:UIControlEventTouchUpInside];
// Add the info button to the navigation bar
UIBarButtonItem *barButtonItem = [[UIBarButtonItem alloc] initWithCustomView:infoButton];
[self.navigationItem setRightBarButtonItem:barButtonItem
animated:YES];
[barButtonItem release];
但有推入每個子視圖設置該按鈕的方式導航堆棧,而不必複製此代碼?
謝謝!