我UIBarButtonItem
创建了三个如下。它们向左对齐,我想对齐中心,因此右侧没有间隙。我看不到的align属性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];