0
当我改变UITextField的位置并打开键盘时,UITextField会跳回到原始位置。swift:当键盘显示时修改的位置将会改变
UIView.animateWithDuration(0.5, animations: {() -> Void in
self.TextField.center.y = self.view.frame.height/2
})
当我改变UITextField的位置并打开键盘时,UITextField会跳回到原始位置。swift:当键盘显示时修改的位置将会改变
UIView.animateWithDuration(0.5, animations: {() -> Void in
self.TextField.center.y = self.view.frame.height/2
})
override func viewDidLayoutSubviews() {
if(ifnew == true) {
self.feld.center.y = self.view.frame.height/2
}
}
我解决