动画 UITextView 时打字
我试图拥有一个可变高度的 UITextView,它可以更改大小以适应其内容,但是当尺寸更改动画中的框架发生变化时,UITextView 中不会捕获一两次击键。动画持续时间为 0.1 秒,通常当您打字速度相当快时,它只会漏掉一个字母。然而,当动画发生时,丢失的字母非常一致。以下动画块发生在 textViewDidChange: delegate message:
[UIView animateWithDuration:0.1 animations:^{
[textView setFrame:CGRectMake(...)];
}];
我已经用 Google 搜索并搜索了 SO,但到目前为止还没有出现任何结果。还有其他人遇到过这种情况吗?
I'm trying to have a variable-height UITextView which changes size to accomodate its contents, but when the frame changes in the size-change animation, one or two keystrokes aren't captured in the UITextView. The animation duration is 0.1s, and typically it only misses one letter when you're typing fairly fast. It is, however, very consistent in missing letters when the animation happens. The following animation block occurs within the textViewDidChange: delegate message:
[UIView animateWithDuration:0.1 animations:^{
[textView setFrame:CGRectMake(...)];
}];
I've Googled and searched on SO, but so far nothing has come up. Has anyone else encountered this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
默认情况下,UIView 动画禁用动画视图的用户交互,因此可能(抱歉现在无法测试)显式启用用户交互将解决您的问题:
By default UIView animations disable user interaction for animated view, so possibly (sorry cannot test it now) explicitly enabling user interaction will solve your problem: