嘿伙计们,
我将工具栏作为附件视图附加到键盘上。
[textView setInputAccessoryView:toolbar];
它有一个barButtonItem
。我需要在按钮上显示popOver
。我知道要用
presentPopoverFromBarButtonItem:permittedArrowDirections:animated:
但这会使popOver
显示出奇怪的方向。我试过各种黑客但没有运气。以前有人有这样的问题吗?
创建PopOverController的代码。
- (void) audioRecord:(id)sender event:(UIEvent*)event
{
UIBarButtonItem *audioBarButtonItem = (UIBarButtonItem *)sender;
if(audioInputController == nil)
{
audioVC=[[AudioTextViewController alloc] init];
audioVC.delegate = self;
self.audioInputController=[[UIPopoverController alloc] initWithContentViewController:audioVC];
CGSize audioViewSize = audioVC.view.frame.size;
audioInputController.delegate = self;
[self.audioInputController setPopoverContentSize:audioVC.view.frame.size];
[audioInputController presentPopoverFromBarButtonItem:audioBarButtonItem permittedArrowDirections:UIPopoverArrowDirectionDown animated:YES];
}
}