【发布时间】:2010-10-10 19:17:45
【问题描述】:
我创建了三个UIBarButtonItem,如下所示。它们向左对齐,我想对齐中心,所以右侧没有间隙。我在UIToolBar 上看不到 align 属性。有没有其他方法可以做到这一点?
//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];
【问题讨论】:
标签: ios cocoa-touch uitoolbar