简体   繁体   English

当键盘出现时,弹出视图箭头移动

[英]Popover View Arrow Moves When Keyboard Appears

I have a popover view with a search bar and search bar delegate. 我有一个带有搜索栏和搜索栏代表的弹出窗口视图。 When the popover view is presented it points the arrow at the button I press to pull it up as expected. 当弹出视图出现时,它指向按下按钮的箭头,按预期将其拉起。 When the search field is selected and my view is pushed up, the arrow moves all the way to the bottom of the popover instead of pointing at the button it should be anchored to. 选择搜索字段并向上推视我的视图时,箭头一直移动到弹出框的底部,而不是指向应该固定到的按钮。 If the keyboard is dismissed the arrow slides back to where it should be in the middle of the popover. 如果键盘被解除,箭头将滑回到弹出窗口中间的位置。

I can dismiss this popover and manually call another one with the arrow in the right place, but I feel like that is a terrible solution. 我可以解雇这个弹出窗口,并在正确的位置用箭头手动调用另一个,但我觉得这是一个可怕的解决方案。

It is being presented like this when the button is pressed 按下按钮时显示如下

[over presentPopoverFromRect:self.addCategoryButton.bounds inView:self.addCategoryButton permittedArrowDirections:UIPopoverArrowDirectionLeft animated:YES];

let's say the button is a subview for self.view. 假设该按钮是self.view的子视图。 My guess is the popover should be presented like this: 我的猜测是popover应该像这样呈现:

[over presentPopoverFromRect:self.addCategoryButton.frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionLeft animated:YES];

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM