我在其中提供了带有UITextField的popover。一切正常(箭头指向sourceRect)。然后我点击文本字段并打开键盘。弹出窗口移动,箭头方向改变。那太好了。但是当我解雇键盘时,箭头仍然朝着同一方向。
这是我的简单项目https://github.com/sirljan/PopoverArrow
我这样说:
public class MyHeaderview: UITableViewHeaderFooterView {
// Add views to contentView
public override func layoutSubviews() {
super.layoutSubviews()
contentView.frame = bounds
}
}
我想只向上或向下箭头。我只读$('#example').DataTable( {
"ajax": '/data/handle'
"serverSide": true,
});
,因此在调用- (IBAction)buttonTapped:(UIButton *)sender {
UIStoryboard *sb = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
UIViewController * vc = [sb instantiateViewControllerWithIdentifier:@"MyPopover"];
vc.modalPresentationStyle = UIModalPresentationPopover;
vc.popoverPresentationController.sourceView = self.view; \\self.view is sender.superview
vc.popoverPresentationController.sourceRect = sender.frame;
vc.popoverPresentationController.permittedArrowDirections = UIPopoverArrowDirectionDown | UIPopoverArrowDirectionUp;
[self presentViewController:vc animated:YES completion:nil];
}
时我无法更改它。您有任何建议如何正确设置箭头吗?