<< | Index | >>
Constants list
// Button UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; button.frame = CGRectMake(0, 0, 60, 40); UIFont *font = [UIFont fontWithName:@"FontAwesome" size:14.0]; [button.titleLabel setFont:font]; [button setTitle:@"\uF013" forState:UIControlStateNormal]; // cog icon [button addTarget:self action:@selector(foo:) forControlEvents:UIControlEventTouchUpInside]; // add to toolbarItems UIBarButtonItem *settingsBarButton = [[UIBarButtonItem alloc] initWithCustomView:button]; self.toolbarItems = [NSArray arrayWithObjects:settingsBarButton, nil];
UILabel does not have setTitle:forState method.
UIButton has textLabel after iOS 3.0.
But textLabel's title does not show any text (Use UIButton's setTitle:forState
instead of this property)
Toolbar of NavigationController has some magin.
Then used FixedSpace
of last item in toolbar.
UIBarButtonItem *margin = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil]; margin.width = -12;
References of UIKit (UIBarButtonItem, UIButton, UILabel)
UITableViewStyleGrouped
for UITableView.
Create ModalView as NavigationController
_settings = [[SettingsViewController alloc] init]; _settings.modalTransitionStyle = UIModalTransitionStyleCoverVertical; UINavigationController *settingsNavigation = [[UINavigationController alloc] initWithRootViewController: _settings]; [self presentModalViewController:settingsNavigation animated:YES];