문제

This has been bothering me for few weeks.

Here's a screenshot:

enter image description here

I copied this view Controller from a sample project.

Now I need to replace the Textfield with a UITextView instead.

The problem is I can't seem to be able to drag and drop it to a Bar Button Item.

I literally removed the textField then tried to drag and drop the textview, the Bar Button Item just wont highlight.

What am I missing?

PS: it works with UITextfield only.. why ?? o.O'

도움이 되었습니까?

해결책

I think you are referring to the inputAccessoryView, it's a UIView which gets displayed when the textview becomes first responder. hence when the keyboard shows.

You can customize the UIView to hold all controls you want: textview, buttons, etc. More details here.

Basically, you implement your custom keyboard tool bar which is a UIView subclass (I assume you want something like the messages app), then you set the custom UIView to the inputAccessoryView property of the UITextView. here is a relevant link to get you started: http://gabriel-tips.blogspot.com/2011/05/input-accessory-view-how-to-add-extra.html

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top