This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Display a right bar Close button item | |
UIBarButtonItem *bbi = [[UIBarButtonItem alloc] initWithTitle:@"Close" style:UIBarButtonItemStyleBordered target:self action:@selector(doClose:)]; | |
self.navigationItem.rightBarButtonItem = bbi; | |
[bbi release]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Displaying a right bar info button item | |
UIButton *btn = [UIButton buttonWithType:UIButtonTypeInfoDark]; | |
[btn addTarget:self action:@selector(doSomeAction:) forControlEvents:UIControlEventTouchUpInside]; | |
UIBarButtonItem *bbi = [[UIBarButtonItem alloc] initWithCustomView:btn]; | |
self.navigationItem.rightBarButtonItem = bbi; | |
[bbi release]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Resize a UIButton according to its title's length. | |
CGSize stringSize = [self.myButton.titleLabel.text sizeWithFont:self.myButton.titleLabel.font]; | |
CGRect frame = self.myButton.frame; | |
frame.size.width = stringSize.width; | |
[self.myButton setFrame:frame]; |
NewerOlder