i 在我看来,控制人员的确装满了同样的负荷。 项目不适宜工具条。 它左边。 任何帮助? 如何赋予工具禁运所有权?
UIToolbar *toolbar = [UIToolbar new];
toolbar.barStyle = UIBarStyleBlackTranslucent;
// create a bordered style button with custom title
UIBarButtonItem *playItem = [[[UIBarButtonItem alloc] initWithTitle:@"Play"
style:UIBarButtonItemStyleBordered
target:self
action:@selector(flipToSchedules:)] autorelease];
self.navigationItem.rightBarButtonItem = playItem;
NSArray *items = [NSArray arrayWithObjects: playItem, nil];
toolbar.items = items;
// size up the toolbar and set its frame
// please not that it will work only for views without Navigation toolbars.
[toolbar sizeToFit];
CGFloat toolbarHeight = [toolbar frame].size.height;
CGRect mainViewBounds = self.view.bounds;
[toolbar setFrame:CGRectMake(0, 20,
CGRectGetWidth(mainViewBounds), toolbarHeight)];
[self.view addSubview:toolbar];