- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我目前正在启动一个新的测试项目,用于通过单独的(模态) View 导入客户端证书。该应用程序始终以 View “主视图”(Main View)开头,其中我有一些虚拟元素来测试连接是否有效。一旦用户将文件添加到我的应用程序(例如,在邮件中打开它或在模拟器中拖放),“证书导入” View 将通过 Segue 显示。当用户点击“输入证书密码”文本字段时,键盘会弹出。返回时,如果输入的密码对于导入的 p12 客户端证书是正确的,则调用 .resignFirstResponder() 并通过标签应用程序。我希望我的“证书导入” View ( Certificate Import View ) 在应用程序关闭或多任务处理被激活时被关闭。我通过在 CertificateImportViewController 上的应用程序委托(delegate)的 applicationWillResignActive(application:) 方法中调用 dismiss(animated:completion:) 来实现这一点。
现在,当我关闭我的应用程序或仅在“证书导入 View ”中显示键盘后切换到多任务处理时,我的问题就出现了。
当我在以下状态下关闭/执行多任务应用程序时,我会在调试器控制台中获得相应的条目:
当显示键盘并且我在证书导入 View 中时:[快照] 对不在可见窗口中的 View (0x7fa91506b200, UIKeyboardImpl) 进行快照需要 afterScreenUpdates:YES。
即使我离开证书导入 View 并回到“主视图”:[快照] 对不在可见窗口中的 View (0x7fa91506b200, UIKeyboardImpl) 进行快照需要 afterScreenUpdates:YES。
在证书导入 View 中显示键盘后,离开应用程序,再次打开应用程序,然后关闭/多任务处理应用程序:[快照] 快照 View (0x7f99e3821600,UIKeyboardImpl)尚未至少被渲染一次需要 afterScreenUpdates:YES。
我试图找出是什么让操作系统认为它必须拍摄包括键盘在内的快照,即使主视图从不显示键盘。我还试图找出为什么键盘认为它必须在键盘被关闭后对键盘进行快照 (resignFirstResponder())。我不确定如何调试将我的证书导入 View 保存在堆栈上的内容(我认为这可能是一个原因)。
AppDelegate.swift
func applicationWillResignActive(_ application: UIApplication) {
guard let rv = window?.rootViewController as? UINavigationController else {
print("No Navigation Controller")
return
}
if let r = rv.presentedViewController as? UINavigationController, let c = r.topViewController as? CertificateImportViewController {
c.dismiss(animated: true, completion: nil)
}
}
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
self.fileBlobURL = url
guard let rv = window?.rootViewController as? UINavigationController else {
print("No Navigation Controller")
return false
}
guard let myEntryViewController = rv.topViewController, myEntryViewController.title == "MainView" else {
print("Wrong View Controller")
return false
}
myEntryViewController.performSegue(withIdentifier: "ShowCertificateImport", sender: myEntryViewController)
return true
}
CertificateImportViewController.swift
class CertificateImportViewController: UIViewController {
var fileURL: URL?
var credential: URLCredential?
@IBOutlet weak var certpwTextField: UITextField!
@IBOutlet weak var certResult: UILabel!
@IBOutlet weak var saveButton: UIBarButtonItem!
override func viewDidLoad() {
super.viewDidLoad()
certpwTextField.delegate = self
let appdelegate = UIApplication.shared.delegate as! AppDelegate
guard let u = appdelegate.fileBlobURL else {
print("No file blob path found!")
return
}
self.fileURL = u
}
@IBAction func cancel(_ sender: UIBarButtonItem) {
dismiss(animated: true, completion: nil)
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
certpwTextField.resignFirstResponder()
certpwTextField.delegate = nil
}
}
最佳答案
经过更多的研究,包括大量的试验和错误,我意识到:
但是,如果将来有人找到解决此问题的解决方案,出于好奇,我会对它是如何完成的非常感兴趣。
关于ios - 在显示键盘后离开应用程序时出现快照错误(需要 afterScreenUpdates :YES),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56898912/
Maven – 快照 大型软件应用程序通常由多个模块组成,这是多个团队工作于同一应用程序的不同模块的常见场景。例如一个团队工作负责应用程序的前端应用用户接口工程(app-ui.jar:1.0)),同
我的 ES 快照不起作用或看起来是空的。 首先,我在我的 Ubuntu 服务器上做了这个: 1.创建备份目录 mkdir /home/admin/dumps/elasticsearch 2. 将此目录
您好,我想将折线图保存为预定义尺寸 (x, y) 的图像。有没有简单的方法来做到这一点?我找不到任何合适的 Snapshot 参数。 WritableImage image = lineCha
我将 Genymotion 与 Oracle VirtualBox 一起使用,但是我有 250 GB 的 SSD,并且我遇到了(快照)问题 我在这里搜索并搜索,我找不到任何可能的方法来禁用自动快照,因
我们想使用 Grafana 来显示测量数据。现在,我们的测量设置创建了大量数据并保存在文件中。我们按原样保留文件,并直接使用 Spark(“数据湖”方法)对其进行后处理。 我们现在想要创建一些可视化,
我不知道如何制作节点组的快照。也就是说,我想制作一个覆盖有数字的 PNG 图标图像(例如未读消息)。 我的代码: int totalNumberOfUnreadMessages = 1; ImageV
我们想使用 Grafana 来显示测量数据。现在,我们的测量设置创建了大量数据并保存在文件中。我们按原样保留文件,并直接使用 Spark(“数据湖”方法)对其进行后处理。 我们现在想要创建一些可视化,
这个问题在这里已经有了答案: How do I return the response from an asynchronous call? (41 个回答) 关闭 4 年前。 function i
我试图在运行我的程序时保存所有内容。我想保存每个游戏对象及其脚本和变量。我知道可以序列化所有内容并将其保存为 XML(以及其他方式/格式,如 JSON)。这将需要大量的工作和时间。该程序将来可能会发生
我正在玩 Screeps ( http://screeps.com/ ) 模拟房间模式。我已经测试了一些东西,我不想失去我的进步。 我可以在模拟房间模式下拍摄快照并保存我的房间状态,这样我就不必从头开
我的应用程序的测试人员报告:“最近的应用程序列表中的应用程序缩略图根本没有调整。在我看来,它要么像主屏幕壁纸(tolikdru:可能,只是透明的矩形),要么像应用程序屏幕的绿色背景,但从来没有真正的应
这个问题在这里已经有了答案: JavaFX I want to save Chart-Image completely (1 个回答) 关闭 3 年前。 我正在尝试获取“Java 弹出窗口”的快照。
我正在使用 pymongo 从 MongoDB 中插入和检索数据。这两个操作可以同时执行。问题是我什么时候做 rows = db..find()在pymongo中,每次rows.count()返回不同
如何获取通过 选择的视频文件的快照在视频中的特定时间在后台静默(即没有可见元素、闪烁、声音等)? 最佳答案 主要有四个步骤: 创建 和 元素。 加载src URL.createObjectURL 生
您好,我正在使用 JavaFx WebView 创建 HTML 页面的屏幕截图,它工作正常,但我想知道是否可以在不在图形窗口中启动应用程序的情况下执行此操作!!我的意思是没有比这更轻量级的方法来获取屏
所以我有一个 horizontalscrollview,我想尝试添加一个对齐效果,它基本上使元素居中。到目前为止,我基本上都是用 XML 完成的。 然后我在里面有一个 LinearLayout。
调用 URL http:///gitweb.cgi?p=;a=tree;f=;hb=HEAD将显示 的树从 开始. 调用 URL http:///gitweb.cgi?p=;a=snapshot;
我们知道,Maven 项目第一次构建时,会自动从远程仓库搜索依赖项,并将其下载到本地仓库中。当项目再进行构建时,会直接从本地仓库搜索依赖项并引用,而不会再次向远程仓库获取。这样的设计能够避免项目每次构
这个问题在这里已经有了答案: Freeze screen in chrome debugger / DevTools panel for popover inspection? (9 个回答) 关闭
我正在开发一个向 DVR 和 IP 摄像机请求快照的应用程序。我正在开发的设备只提供 RTSP 请求。然后我实现了必要的 RTSP 方法来开始接收流数据包,然后通过建立的 UDP 连接开始接收。我的疑
我是一名优秀的程序员,十分优秀!