问题标签 [uimodalpresentationstyle]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
ios - iOS:在使用 UIModalPresentationStyle.OverCurrentContext 时检测dismissViewControllerAnimated
在我的ViewControllerA中,我尝试通过调用来显示ViewControllerB :
所以ViewControllerB的内容显示在ViewControllerA的顶部。
当按下ViewControllerB中的按钮时,这被称为:
但是,viewWillAppear
ViewControllerA没有被调用。
如果VC2.modalPresentationStyle = UIModalPresentationStyle.OverCurrentContext
删除该行,则viewWillAppear
调用ViewControllerA 。
使用时UIModalPresentationStyle.OverCurrentContext
,不会调用ViewControllerA的。在这种情况下,如何检测ViewControllerB 是否在 ViewControllerA中被解除?我想在 ViewControllerA 中运行一些代码,但不在ViewControllerB中使用of 。viewWillAppear
completion
dismissViewControllerAnimated
ios - 调试时面临警告问题
背景
我正在截取 viewController 的屏幕截图并将其呈现在 collectionViewCell 中。collectionViewCell 的布局是水平的,但是当我选择一个视图然后旋转设备然后再回到 collectionView 时,布局是垂直的。
调试:我在代码中放置了一个断点,在调试区域中,我尝试检查变量的输出,这就是下面的警告开始出现的地方。
我在用着 :-
- Xcode 版本:7.1
- iOS:9.1
注意 - 我在 Xcode 6.4 上使用iOS8运行的代码相同,它运行时没有出现故障/警告。此外,我能够在调试区域中找到变量的值。
更多信息 :-
断点 -我把它放在下面的方法中
在调试区域中触发的命令 -
po viewController
预期结果 -
像往常一样具有像框架一样的细节的 viewController 的值。
实际结果 -
上面提到的警告。
我正在尝试调试的内容-
在 iOS 9 中,collectionView 单元格的布局会自动更改(在旋转后出现在另一个下方),而在 iOS 8 中的其他布局(水平视图)是完美的。
提前致谢。
ios - 弹出窗口可见时禁用所有交互
我正在ViewController.modalPresentationStyle = UIModalPresentationPopover;
从左栏按钮操作中展示一个弹出控制器(带有)。在右栏按钮操作中,我触发了一个 push segue。理想情况下,当 popover 可见时,不应发生与 popover 后面的视图的交互。但是,即使弹出框可见,我也可以单击右栏按钮并推动新的视图控制器,而不会关闭弹出框。
我的代码是
我尝试将 popover 演示控制器设置passthroughViews
为 nill 和空数组,但没有结果
弹出窗口可见时如何禁用所有交互?
更新 :
如果弹出框可见并且我们在导航栏中有任何交互,则会发生这种情况。简而言之,即使弹出框可见,它也会与导航栏进行交互。有什么办法可以禁用它吗?
ios9 - 在 iPhone 上显示视图控制器模式后崩溃
我正在尝试为 iPad 和 iPhone 实现 Popover。在 iOS 9 之前,iPad 和 iPhone 有不同的 ViewController。使用 iOS9 应该有可能使用普通的 ViewController 和不同的 PresentationStyles 来做到这一点?(部署目标是 iOS 9.0)对吗?
根据这篇文章:
来自 Daniel Galasko 的 Stackoverflow 答案
我试图在目标 c 中实现这个答案。
崩溃将出现在这一行:
我的日志只会给我这个:
ios - modalPresentationStyle=UIModalPresentationCustom 时未调用 viewDidAppear 和 viewDidDisappear
我需要做一个自定义演示动画,当我同时设置这些 setTransitioningDelegate 和 modalPresentationStyle=UIModalPresentationCustom
除非在呈现的视图控制器中未调用 viewDidAppear 和 viewDidDisappear,否则动画是完美的。这与https://developer.apple.com/library/ios/samplecode/LookInside/Introduction/Intro.html中的 Apple 示例代码相同
为什么在没有给出 modalPresentationStyle 时调用这些方法?
ios - 键盘关闭后弹出箭头
我在其中呈现带有 UITextField 的弹出框。一切正常(箭头指向 sourceRect)。然后我点击文本字段并打开键盘。弹出框被移动并且箭头方向被改变。那也很好。但是当我关闭键盘时,箭头保持在同一方向。
这是我的简单项目https://github.com/sirljan/PopoverArrow
我是这样介绍的:
我只想让箭头向上或向下。是只读的,所以在被调用popoverPresentationController.arrowDirection
时我无法更改它。
- popoverPresentationController:willRepositionPopoverToRect:inView:
您对如何正确设置箭头有什么建议吗?
ios - UIPopoverPresentationController 在 iPhone 上显示全屏模式
在 iPad 上 UIPopoverPresentationController 工作正常,但在 iPhone 上它总是显示全窗口模式弹出窗口。我正在使用以下代码:
ios - 关闭视图控制器后模态显示视图控制器
此问题仅在 iPhone 5 上出现,无论 iOS 版本如何。
- 我从这次呈现的 firstViewController 中呈现 secondViewController。
- 然后我解雇了 secondViewController。
- 我尝试从 firstViewController 再次呈现 secondViewController,这次它没有呈现但 UI 被阻止,
通过记录该过程,我可以看到第一次调用 viewWillAppear 方法,但没有第二次调用该方法。
第一视图控制器
第二视图控制器
ios - 正确关闭新的 ViewController 页面
请帮我关闭我的 ViewControllers。我使用以下代码打开新的 ViewController(“SettingsPage”):
然后我需要返回(关闭 SettingsPage),当我使用这种方法时,我会得到双倍的 MainView
如何正确关闭新的 ViewController(“SettingsPage”)女巫像 .OverFullScreen 一样打开,然后返回到我的 MainView?