2010-10-03 36 views

回答

1

是。在你的目標方法中,只需更換UIBarButtonItem

- (void)toolbarButtonPressedAwesomeMethod { 

    Do awesome stuff... 

    // Change the button here… 
    UIBarButtonItem *bbi = [[[UIBarButtonItem alloc] init… 

    // Set it in the view 
    [self.navigationItem setRightBarButtonItem:bbi]; 
} 
0

yourButton.image = [UIImage imageNamed:@"yourImage"];

UIBarItem Documentation

+0

如果我們想要一個豐富多彩的圖像,它不會像那樣工作。 – wolverine 2010-10-03 18:27:15