Background
I need to display a popover from imageview (a rectangle, not a barbutton) that has a search box. Popper must be submitted from UIModalPresentationFormSheet. This is successfully achieved.
Problem
The problem I am facing (in landscape mode) is when the keyboard is displayed, the modal shape of the sheet moves up and along with it my frame for popover.Hence popover remains in its original position (before the keyboard was shown) and the rectangle presented moves up. The solution I applied is (using presentPopoverFromRect) popover in -(void)didShowKeyBoard:(NSNotification*) notif from the changed rect and does the same in -(void)didhideKeyBoard:(NSNotification*) notif . This works fine, but the transition is very fast and resilient. So how can I achieve a smooth transition for this?
What i tried
I tried:
[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];
but it didn’t work.
Can someone direct me to the right way to do this?
Any help is appreciated.
source share