背景:
我需要显示一个带有搜索字段的imageview(rect而不是barbutton)的popover.需要从UIModalPresentationFormSheet中显示popover.这已成功实现
问题:
我面临的问题(在横向模式下)是当键盘显示时模态表单向上移动并且弹出窗口我的框架.然后弹出框保持在原始位置(键盘显示之前)和呈现rect向上移动.我应用的解决方案是从更改后的矩形表示(using presentPopoverFromRect)弹出窗口-(void)didShowKeyBoard:(NSNotification*) notif并执行相同的操作-(void)didhideKeyBoard:(NSNotification*) notif.这样可以正常工作但过渡非常快且有弹性.那么,我怎样才能实现平稳过渡呢?
我试过了什么
我试过了 :
[UIView beginAnimations:nil context:nil];
[UIView setAnimationCurve:UIViewAnimationCurveLinear];
[UIView setAnimationDuration:5.0f];
[_statePopover presentPopoverFromRect:stateHandler.frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionUp animated:NO];
[UIView commitAnimations];
Run Code Online (Sandbox Code Playgroud)
但它不起作用.
有人可以指导我这样做的正确方法吗?
任何帮助都非常感谢.