I want to insert UIImageView in UITextView of Toolbar having send and camera button in the same way as iPhone default SMS app do.
You would be better off using a UIScrollView
and managing UITextView
s and UIImageView
s in it. UITextView
doesn't support adding image inline with text. In fact, it doesn't really support anything other than multiline text.
Per your comment below, there are three things I can think of to get the image as part of the text entry box:
UITextView
, but instead some custom view. That sort of thing is difficult to replicate.UIImageView
over the UITextView
as a subview and setting the contentInset of the UITextView
so there is no overlap. UIView
to contain both the UITextView
and UIImageView
as subviews and simply arrange those subviews as needed.Both 2 & 3 are very similar (just slightly different approaches) and probably your best approach. Personally, I think 3 is probably the best, since it give you the most control over the position of both views, but 2 should also work fine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With