Changing the frame of an inputAccessoryView in iOS 8

后端 未结 9 2120
遇见更好的自我
遇见更好的自我 2020-12-13 02:42

Long time lurker - first time poster!

I am having an issue while recreating a bar with a UITextView like WhatsApp does it.

I am using a custom <

9条回答
  •  自闭症患者
    2020-12-13 03:05

    Yep, iOS8 adds a private height constraint to the inputAccessoryView.

    Taking into account that recreating whole inputAccessoryView and replace old one is can be really expensive operation, you can just remove constraints before reload input views

    [inputAccessoryView removeConstraints:[inputAccessoryView constraints]];
    [textView reloadInputViews];
    

    Just another workaround

提交回复
热议问题