iphone - 如何将模态视图添加到当前 View Controller 上?

标签 iphone objective-c ios uiviewcontroller modalviewcontroller

我有这个代码:

-(void)applicationDidBecomeActive:(UIApplication *)application {
JUnlockController *passcodeView = [[JUnlockController alloc] init];
[self.navigationController presentModalViewController:passcodeView animated:YES];
}

问题是,当我在我的应用程序中打开模态视图 Controller 时,它不会出现在其顶部。我希望能够找出用户正在查看的当前 View Controller ,以便我可以将其显示在顶部。

最佳答案

而不是:

[self.navigationController presentModalViewController:passcodeView animated:YES];

用途:

[self presentModalViewController:passcodeView animated:YES];

关于iphone - 如何将模态视图添加到当前 View Controller 上?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11505728/

相关文章:

iphone - 是否有任何用 objective-c 或 c 编写的 PDF 解析器?

ios - 在 iOS 上使用 Core Image 的内存高效方式?

iphone - 如何让我的计时器在后台运行,然后发送本地通知?

ios - React Native 中的原生 iOS View

ios - 为什么我的弯曲文本没有自行居中?

ios - 如何修复核心图中 x 轴和 y 轴之间的间隙

iphone - iPad 上捕获 View 上下文的质量低下

objective-c - 如何以编程方式连接 UIButton 和方法?

ios - UITextField 自定义如何选择或插入文本

iphone - 在 UITableView 中显示元素,就像 iPhone 联系人一样,分成按字母顺序排列的部分?