In my app I have a UITextView
and a button just below the text view to insert a photo into the UITextView
while editing.
My requirement is that the user user is able to edit the text within, and insert images when needed.
Similar to StackOverflow's app's own UITextView
:
just add as a subview of TextView like bellow..
Check this out, ios-5-rich-text-editing-series . In iOS 5 you can insert images and use HTML texts. You might have to use
UIWebview
and webkit.You can also check with EGOTextView which has a lot of rich text editing features.
If you add it only as a subview, some text can be "behind" the image. So add the code which will "tell" the text, that area of the image is inaccessible:
You can add the image view as a subView of
UITextView
.Create an imageView with image:
Edit:
For avoiding the overlapping use (Thanks @chris):
Create subclass of UITextView and override this method