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];