我正在使用 PhoneGap 1.3 并尝试在我的工具栏右侧创建一个 iOS 添加按钮;但是,该createToolBarItem
方法没有任何选项来设置项目的位置。我怎样才能做到这一点?下面是 NativeControls.h 中的一段代码:
//create the toolbar in `createToolBar` method://
toolBar = [[UIToolbar alloc] initWithFrame:toolBarBounds];
//....set some toolbar options like .hidden, .barStyle, etc.//
[toolBar setFrame:toolBarBounds];
[self.webView setFrame:webViewBounds];
//add the toolbar to the webview
[self.webView.superview addSubView:toolBar];
//create the button item in `createToolBarItem` method:
item = [[UIBarButtonItem alloc] initWithBarButtonSystemItem: UIBarButtonSystemItemAdd target:self action:@selector(toolBarButtonTapped:)];
[toolBarItems insertObject:item atIndex:[tagId intValue]];
[item release];
//then in `showToolBar` method//
[toolBar setItems:toolBarItems animated:NO];