0

I want to write text in textView and later when I add an image to textView I just want this text move under that image. So.. when i made image smaller than bounds of textView text stays on the same line and only moves to the right and appears near by the image, but when i made an image the same size in width as textView its just stays at the same (start) position and doesn't moves at all.. here is code I use:

UIBezierPath *exclusionPath = [UIBezierPath bezierPathWithRect:CGRectMake(CGRectGetMinX(_imageView.frame),
                                                                                        CGRectGetMinY(_imageView.frame), CGRectGetWidth(_imageView.frame),
                                                                                     CGRectGetHeight(_imageView.frame))];

self.textView.textContainer.exclusionPaths= @[exclusionPath];
andrey
  • 671
  • 1
  • 9
  • 20

2 Answers2

0

One possible solution, You can put UITextView with clear background color, on top of UIImageView and animate UIImageView as per your requirement. When the size of UIImageView changes you can also change UITextView frame.

Suryakant Sharma
  • 3,852
  • 1
  • 25
  • 47
0

Set UITextViewDelegate in Your Code

-(void) textViewDidChange:(UITextView *)textView
{
    [TextReview scrollRangeToVisible:NSMakeRange([TextReview.text length], 0)];
}

When You enter text in your textview then it automatically scroll of text in scrollview.

enter image description here

Kirit Modi
  • 23,155
  • 15
  • 89
  • 112