次のコードを指定すると、ボタンはツールバーに表示されません。何か問題がありますか?
UIImagePickerController* cameraPickerController = [[UIImagePickerController alloc] init];
cameraPickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
cameraPickerController.delegate =self;
cameraPickerController.showsCameraControls = NO;
cameraPickerController.toolbarHidden = NO;
UIBarButtonItem *cancelBarButtonItem = [[UIBarButtonItem alloc]initWithTitle:@"Cancel" style:UIBarButtonItemStyleBordered target: self action: @selector(cancel)];
UIBarButtonItem *flexibleBarSpace = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
flexibleBarSpace.width = 1000;
UIBarButtonItem *cameraBarButtonItem = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemCamera target:cameraPickerController action:@selector(takePicture)];
UIBarButtonItem *faceBarButtonItem = [[UIBarButtonItem alloc]initWithTitle:@"Show facemask" style:UIBarButtonItemStyleBordered target: self action: @selector(showFacemask)];
cameraPickerController.toolbar.items = [NSArray arrayWithObjects:cancelBarButtonItem,flexibleBarSpace,cameraBarButtonItem,flexibleBarSpace,faceBarButtonItem,nil];
[self presentModalViewController:cameraPickerController animated:YES];
これらのcancelBarButtonsおよびその他は、理論的にはツールバーに表示されます。ただし、この場合はそうではありません。お知らせ下さい。