搜索了幾個小時後,我仍然遇到了使用UIScrollView和Keyboard的問題。 當鍵盤顯示我正在通過keyboardWillShow方法調整具有contentInset屬性的ScrollView。鍵盤出現時UIScrollView「滯後」
我使用的自動佈局具有良好的約束
func keyboardWillShow(notification:NSNotification)
{
var userInfo = notification.userInfo!
var keyboardFrame:CGRect = (userInfo[UIKeyboardFrameBeginUserInfoKey] as! NSValue).CGRectValue()
keyboardFrame = self.view.convertRect(keyboardFrame, fromView: nil)
var contentInset:UIEdgeInsets = self.ScrollView.contentInset
contentInset.bottom = keyboardFrame.size.height
self.ScrollView.contentInset = contentInset
}
它是一個Xcode的問題還是我做錯了什麼?
在此先感謝
「滯後」是什麼意思? – Fennelouski
當我上下滾動它沒有鍵盤一樣快,我不知道如何描述它 – Lynkz7
你在做什麼'scrollViewDidScroll'或任何其他委託方法,當你滾動被稱爲? – Fennelouski