6

We have a UITextView with a keyboard input accessory - the accessory is another UIView with a few buttons and another UITextView that grows in height as needed to display a message. (similar to what you see in iMessage)

Everything works fine up through iOS7 and the input accessory grows upward above the keyboard when we update the frame size. But with iOS8, the accessory view grows downward extending over the predictive text and keyboard.

Is there a new way to tell the iOS8 keyboard view to relayout the accessory views? I've tried calling ReloadInputViews() and it doesn't seem to change anything.

Stuck on this - thanks for the help.

Ender2050
  • 6,912
  • 12
  • 51
  • 55

2 Answers2

1

I override the addConstraint method on my view as apple sets a constraint with constant height for iOS8. This seems to solve the issue.

Mikael Bartlett
  • 248
  • 2
  • 9
  • I still haven't quite figured this out, but this is definitely the right direction. Thank you for the tip! – Ender2050 Oct 03 '14 at 00:42
  • That didn't work very well. Did you block all constraints from being added via addConstraint? Because that blocks your own constraints too (from IB). – Gui Moura Oct 14 '14 at 21:18
  • This doesnt work :( If you block adding the constraint, it just gets added to the superview. – Craig Siemens Nov 27 '14 at 21:47
0

I meet this problem too. What I do is override inputAccessoryView's layoutSubviews method and make the height is a fixed number. like this:

- (void)layoutSubviews {
    if (self.height > 38) {
        self.height = 38;
    }
}

PS: what strange is when your inputAccessoryView's height is above 50,inputAccessoryView will not grows downward.

frank
  • 2,327
  • 1
  • 18
  • 20