Hiding the Keyboard when losing focus on a UITextView

后端 未结 10 562
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-04 10:34

So I have a UITextView that I\'m using to allow the user to submit some text.

My problem is, I can\'t seem to figure out how to allow the user to \'Cancel\' by tappi

10条回答
  •  甜味超标
    2020-12-04 10:57

    This is an old post, but I was implementing this solution when i found something a lot simpler (maybe it wasn't available back then).

    [self.myTextView endEditing:YES];

    I'm using a UITableView, so I put this line on the didSelectRowAtIndexPath: method. So far, so good...

提交回复
热议问题