我有三个UIBarButtonItem
,如下所示。它们靠左对齐,我想将它们居中对齐,以便右侧没有间隙。 我在UIToolBar
上看不到对齐属性。 有没有其他方法可以实现这一点?
//create some buttons
UIBarButtonItem *aboutButton = [[UIBarButtonItem alloc] initWithTitle:@"About" style:UIBarButtonItemStyleBordered target:self action:@selector(showAbout:)];
[toolbar setItems:[NSArray arrayWithObjects:settingsButton,deleteButton,aboutButton,nil]];
//Add the toolbar as a subview to the navigation controller.
[self.navigationController.view addSubview:toolbar];