animation - 为什么我的动画(有时)会覆盖 Xcode 13 中的选项卡栏控制器?
问题描述
我有一个 UITextView,它从屏幕外(下)开始制作动画。效果很好,除非我按下主页按钮并返回应用程序。然后,文本在选项卡栏控制器上滚动,并且不会停留在视图区域内。我正在运行 Xcode 13。问题发生在模拟器和我的 iPhone12 上。一如既往,我非常感谢您的帮助。这是我的代码:
导入 UIKit
类 InfoViewController: UIViewController {
@IBOutlet weak var helpText: UITextView!
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
animate()
}
// ***************************************************************
// MARK: Animate text view from below screen
// ***************************************************************
func animate() {
UIView.animate(withDuration: 4.0, delay: -0.0, options: []) {
self.helpText.frame.origin.y -= 700
}
}
// ***************************************************************
// MARK: Reset view so it properly animates during
// subsequent views/loads.
// ***************************************************************
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
self.helpText.frame.origin.y += 700
}
}
以下是好操作和坏操作的示例:
解决方案
推荐阅读
- visual-studio - 本地构建代理未获取新构建
- ionic-framework - 如何使搜索栏只有在搜索字段中超过 3 个字符时才可用
- javascript - Netlify“用户无权执行:dynamodb:PutItem on resource”
- php - 如何将两个查询合并在一起以显示一组带有分页的数据
- c++ - 实验性的::filesystem::remove_all() :权限被拒绝
- lucene - org.apache.lucene.document.IntPoint$1 是哪个类?
- php - 来自数据库翻译的 ZendFramework 3 remote_translation
- php - 通过 PHP CURL 发送数据?
- ms-office - Office.js 加载项能否在默认浏览器(而不是 Word 中的新窗口)中从我的域打开一个 html 页面?
- maven - TeamCity/Maven 不要让模块被“跳过”