iPhone X how to handle View Controller inputAccessoryView?

前端 未结 15 2643
长情又很酷
长情又很酷 2020-11-30 00:43

I have a messaging app that has the typical UI design of a text field at the bottom of a full screen table view. I am setting that text field to be the view controller\'s

15条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-30 01:35

    The simplest answer (with just one line of code)

    Simply use a custom view that inherits from UIToolbar instead of UIView as your inputAccessoryView.

    Also don't forget to set that custom view's autoresizing mask to UIViewAutoresizingFlexibleHeight.

    That's it. Thank me later.

提交回复
热议问题