autoresizemask 可以应用于弹出窗口吗

发布于 2024-10-31 16:07:43 字数 983 浏览 6 评论 0原文

再次陷入这个方向问题。我有一个搜索屏幕,当用户点击文本字段时,下面会显示一个弹出窗口,就像下拉菜单一样,但是当方向更改为 ladscape 时,弹出窗口会出现在左侧一点。

这可以处理吗(除了管理坐标)

提前感谢

尝试了这段代码

- (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)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation{

     if (isPopOverNeedToBeManaged) {
            NSLog(@"Popover需要管理");
    
            如果(popOverSender){
                NSLog(@"是的文本字段在那里");
                如果(弹出控制器){
    
    
                    [popoverController PresentPopoverFromRect:txtDDDeliveryCenter.frame inView:子视图 allowedArrowDirections:0 动画:YES];
    
                }
            }
        }
    

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)didRotateFromInterfaceOrientation:(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];
    
                }
            }
        }
    

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

厌味 2024-11-07 16:07:43

观察任何 Apple 本机应用程序中的弹出窗口行为。您将看到,响应设备旋转,弹出窗口应在旋转动画之前消失,并在其结束后再次出现在新的适当位置。因此,您应该关闭弹出窗口,然后使用新坐标将其弹出到新位置。

希望这会有所帮助

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文