I want to insert UIImageView in UITextView of Toolbar having send and camera button in the same way as iPhone default SMS app do.
I want to insert UIImageView in UITextView of Toolbar having send and camera button
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You would be better off using a
UIScrollViewand managingUITextViews andUIImageViews in it.UITextViewdoesn’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.UIImageViewover theUITextViewas a subview and setting the contentInset of theUITextViewso there is no overlap.UIViewto contain both theUITextViewandUIImageViewas 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.