TextField中的IOS8文本在Focus上弹跳 [英] IOS8 Text in TextField Bounces on Focus

查看:97
本文介绍了TextField中的IOS8文本在Focus上弹跳的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个奇怪的错误,我切换到我的应用程序中的屏幕。这会导致第一个文本字段成为第一个响应者,并且光标位于文本字段内。然后在字段中键入一些文本并将焦点切换到下一个文本字段,这会导致第一个框中的文本反弹并返回。这仅在第一次进入相关屏幕时发生。为了复制,我需要退出屏幕并返回到它。任何想法会在第一次失去焦点时导致文本弹跳的原因是什么?为什么文本字段文本一般会反弹?

There is a weird bug where I switch to a screen in my app. This causes the first textfield to become first responder and the cursor is inside the textfield. Then type some text into the field and switch focus to the next textfield, this causes the text in the first box to bounce up and come back down. This happens only on the first time of coming to the screen in question. In order to replicate I need to back out of the screen and go back to it. Any ideas what would cause the text to bounce when focus is lost for the first time? Why would text field text bounce in general?

推荐答案

添加

[textField layoutIfNeeded];

[textField layoutIfNeeded];

开始textFieldDidEndEditing:修复了问题。有什么想法吗?

to start of textFieldDidEndEditing: fixed the issue. Any ideas why?

这篇关于TextField中的IOS8文本在Focus上弹跳的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆