ios - Changing tableview height in swift -
i want change tableview when keyboard appears screen in swift. because if don't update height, bottom messages hides under keyboard. here screenshots:
before:
after:
you can see in screenshots, tableview still under keyboard. used following code , didn't work.
func keyboardwillshow(notification: nsnotification) { var info = notification.userinfo! var keyboardframe: cgrect = (info[uikeyboardframeenduserinfokey] as! nsvalue).cgrectvalue() self.tableview.frame.size.height=self.tableview.frame.size.height-keyboardframe.size.height self.view.layoutifneeded() uiview.animatewithduration(0.2) { self.bottomcons.constant = keyboardframe.size.height //this line textbox , button. unrelated tableview. self.view.layoutifneeded() } }
why tableview height not changing? how can fix it?
Comments
Post a Comment