Prevent table footer from moving along with the keyboard

I have a table view with 4 text fields in the 1st section and 2 radio buttons in the second section. The second section has a custom footer with a button. When I click on any text field, the footer of the second section also moves along with the keyboard. How can I prevent this?

+8
ios uitableview
source share
1 answer

It looks like your KeyboardWillShow / WillHide event constraint changes work, but not the way you want. The footer basically floats at the bottom of the table, so it sounds like if the height of the table is recounted for WillShow, it sets the restriction of the lower table to the top of the keyboard, which is usually what you want. If the constraints are updated correctly and you want to obscure the footer, you can simply compensate for the height restriction of the footer.

| | | | 0 bottom of table | --- top of the keyboard --- top of the keyboard | -YY = height of footer --- bottom of table 

Another option for switching show / hide mentioned in @JD works, it depends only on the behavior you want for users. When editing text fields do they need content in the footer?

0
source share

All Articles