开发者

can autoresizemask be applied on popovers

开发者 https://www.devze.com 2023-02-25 18:20 出处:网络
Again caught up in this orientation issue. I have a search screen where when a user taps on textfields a popover is displayed below that just like a dropdown menu but when the orienattion is changed t

Again caught up in this orientation issue. I have a search screen where when a user taps on textfields a popover is displayed below that just like a dropdown menu but when the orienattion is changed to ladscape popovers appear a bit to the left .

Can this be handled(apart from managing coordinates)

Thanks in advance

tried this piece of code

- (void)willRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation{

if (isPopOverNeedToBeManaged) {
    NSLog(@"Popover need to be managed");

    if (popOverSender) {
        NSLog(@"yes text field is there");
        if (popoverController) {
            [popoverController dismissPopoverAnimated:NO];

        }
    }
}

}

  • (void)didRotateFromInterfaceOri开发者_如何学Goentation:(UIInterfaceOrientation)fromInterfaceOrientation{

        if (isPopOverNeedToBeManaged) {
            NSLog(@"Popover need to be managed");
    
            if (popOverSender) {
                NSLog(@"yes text field is there");
                if (popoverController) {
    
    
                    [popoverController presentPopoverFromRect:txtDDDeliveryCenter.frame inView:subview permittedArrowDirections:0 animated:YES];
    
                }
            }
        }
    


Watch popover behavior in any Apples native application. You'll see that in response to device rotation popover should disappear before rotation animation and appear again on new appropriate place after it ends. So you should dismiss your popover and then popup it on new place with new coordinates.

Hope that'll help

0

精彩评论

暂无评论...
验证码 换一张
取 消