keyboardWillShow will only work from the second time on
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have a UITextView that I need to move up when the user focuses on it. In the simulator I have set up 2 keyboards (English,Greek) Within keyboardWillShow function I change the UITextView's height to be less than the existing one, as in self.page_text.frame = CGRectMake(self.page_text.frame.origin.x, self.page_text.frame.origin.y, self.page_text.frame.width, (notification.userInfo?[UIKeyboardFrameEndUserInfoKey] as NSValue).CGRectValue().origin.y - 180) The problem is that only each first time I focus on the text view the keyboard