I have UITextView
in that in include image/ (UIImageView
).
But when i want to see the image it is unable to see / scroll,
i implemented logic to increase the scroll content size dynamically with respective to the text size,
- (void)scrollViewDidScroll:(UIScrollView *)scrollview
{
if (scrollview.contentOffset.y >= scrollview.contentSize.height - scrollview.frame.size.height)
{
CGSize s = [messageView.text sizeWithFont:[UIFont systemFontOfSize:25] //define your textview font size
constrainedToSize:CGSizeMake(self.view.bounds.size.width - 40, MAXFLOAT) // - 40 For cell padding
lineBreakMode:UILineBreakModeWordWrap];
// To increase the text view scroll content to display image also
[scrollview setContentSize:CGSizeMake(200, s.height+150)];
}
}
but it starts scrolling only when text in the text view exceeds its (textview) bounds.
I was unable to see the full image if the text is with in bounds (no of lines can fit in text view)
How to set scroll size when touch / starts scrolling on textview
,,
use this code after set the text to the messageView(
UITextView
)