当 iPhone 处于通话模式时,如何手动/以编程方式调整 UIView 的大小?

发布于 2024-12-25 11:39:46 字数 1179 浏览 2 评论 0原文

在我的地图应用程序中,MapView 控制器在电话呼叫模式下打开得很好。当我打开同一控制器中的另一个 UIView(子视图)detailView 时,它不会在电话呼叫模式下调整大小。我已关注 Iphone-如何在通话状态栏时调整视图大小已切换? 该链接还尝试自动调整我的 UIView 大小,但问题仍然存在。 我的详细信息视图即将离开屏幕(向下)。还有其他解决方案或者我在代码中遗漏了一些东西吗?请建议..

编辑 实际上我的第一个视图控制器包含分段按钮上的地图视图和表格视图。详细视图在同一屏幕上作为 UIView 在注释标注上打开。我的详细视图包含 4 个带有 4 个标签的按钮以及顶部和底部栏。底部栏的一半在通话模式下隐藏。

     //BusinessCard(detailview) content
     ShowroomName.autoresizingMask =  UIViewAutoresizingFlexibleBottomMargin; //label
    Address_Bcard.autoresizingMask =  UIViewAutoresizingFlexibleBottomMargin; //label
    p_Bcard.autoresizingMask =  UIViewAutoresizingFlexibleBottomMargin; //button
    e_Bcard.autoresizingMask =  UIViewAutoresizingFlexibleBottomMargin; //button
    w_Bcard.autoresizingMask =  UIViewAutoresizingFlexibleBottomMargin; //button
    aButton.autoresizingMask =  UIViewAutoresizingFlexibleBottomMargin; //button

    ViewOnMapButton.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleTopMargin;  //button on bottom bar

In my map application the MapView controller is opens well in phone call mode. When I open detailView which is another UIView(subview) in same controller it does not get resize in phone call mode. I have followed
Iphone- How to resize view when call status bar is toggled?
the link also try to autosize my UIView but still the problem exist. My detailView is going out(down) of screen. Is there any other solution or I am missing something in code?? plz suggest..

Edit
Actually my firstView controller contains mapview and tableview on segment button. And detailview which opens on annotation callout as UIView on same screen. My detailview contain 4 buttons with 4 labels and top and bottom bar. The the half of bottom bar get hide in phone call mode..

     //BusinessCard(detailview) content
     ShowroomName.autoresizingMask =  UIViewAutoresizingFlexibleBottomMargin; //label
    Address_Bcard.autoresizingMask =  UIViewAutoresizingFlexibleBottomMargin; //label
    p_Bcard.autoresizingMask =  UIViewAutoresizingFlexibleBottomMargin; //button
    e_Bcard.autoresizingMask =  UIViewAutoresizingFlexibleBottomMargin; //button
    w_Bcard.autoresizingMask =  UIViewAutoresizingFlexibleBottomMargin; //button
    aButton.autoresizingMask =  UIViewAutoresizingFlexibleBottomMargin; //button

    ViewOnMapButton.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleTopMargin;  //button on bottom bar

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

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

发布评论

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

评论(1

素罗衫 2025-01-01 11:39:46

尝试使用

ViewOnMapButton.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin;

Also 对于您需要相应检查和更新的特定标签位置。

Try using

ViewOnMapButton.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin;

Also for specific label position you need to check and update accordingly.

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