佚名通过本文主要向大家介绍了囚禁之时中文字幕,飞耐时3中文说明书,跑步时听的中文歌曲,樱花纷飞时中文版,开车时听的中文歌等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
问题: iOS10 textfield 输入中文时文字会下沉
描述:
解决方案1:
描述:
iOS10 UITextField输入中文时文字会下沉,输入英文则是正确的,不会有任何影响。输入完闭丢失焦点后位置回到正确的位置。真机和模拟器效果一样。
字体是14号字,textfield是30的高,应该能容纳下当前的字体
这是我的截图:
以下是我所有的代码:
import UIKit
class ViewController: UIViewController,UITextFieldDelegate{
@IBOutlet weak var textField: UITextField!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
self.view.endEditing(true);
}
}
这是我的storyboard设置截图:
解决方案1:
试试用textView吧
解决方案2:iOS 10 自身的问题,看一下今天的 10.1 有没有修正吧。
解决方案3:可能是ios10点bug!我也发现了,没办法。