我需要在ToolBar的中心添加一个按钮。我已经成功地将按钮添加到工具栏部分。我的问题如下:在UIToolbar中居中放置UIBarButtonItem并添加自定义文本
1.)我需要居中这个barbutton。它应该在工具栏的中心
2.)我需要在显示刷新按钮图像后有文本。
toolBar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0 , 320 , 60)];
NSMutableArray* button = [[NSMutableArray alloc] initWithCapacity:1];
UIBarButtonItem *barButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh target:self action:@selector(refreshButtonAction:)];
[button addObject:barButton];
[toolBar setItems:button animated:NO];
[self.view addSubview:toolBar];
是的,我有代码:(做到这一点你能告诉我一个示例代码说明如何实现这一点? – sharon 2011-12-29 15:40:51