0

I'm developing a "pitch 'n putt" score card app (it's going to change the world). Except I've been pulling my hair out over using the UITableViewFooter.

When I click the player name, the keyboard appears but this is pushing the Footer up with the keyboard ,The overall effect does not look very good.

I've attached some screen shots which hopefully explain it better.

Is there a way to disable this behaviour?

Step 1 - Click Name

enter image description here

Step 2 - Keyboard appears and score totals are moved up as well.

enter image description here

halfer
  • 19,824
  • 17
  • 99
  • 186
Dono
  • 43
  • 4
  • http://stackoverflow.com/questions/5740518/uitableview-footer-stop-from-floating-over-content – Tim Nov 29 '15 at 04:53
  • Hi Tim, thanks for the reply. What I left out is I want this behaviour, it's perfect. As you type in your score you always see the total at the bottom. But the movement / repositioning of the footer when the keyboard appears makes the app seem less polished. Thank you – Dono Nov 29 '15 at 07:21

1 Answers1

1

I've turned into one of those guys that posts a question and solves it.

Anyway, in case it helps anyone else here is what I did.

1 - Create a global variable of

var playerFooter: UIView?

2 - in my func tableview (... viewForFooterInSection...)

just before my return

playerFooter = containerView (whatever you are returning)

3 - Add a notification for Keyboard show/hide and in side call

playerFooter!.hidden = true (or false depending on the notification)

It works great! but I won't claim this is the most efficient way of doing it.

When the keyboard appears the section disappears, when the keyboard disappears the footer reappears.

Thank you.

Dono
  • 43
  • 4