I have one UITextView, and I want to add a custom one to it UIViewand make the text flow higher and lower as follows:
+----------------+
|------txt-------|
| |
| UIView |
| |
|------txt-------|
|----------------|
|----------------|
+----------------+
I tried to achieve this by adding an exception path that has width UITextViewand height UIView, for example:
CGRect exclusionFrame=CGRectMake(0,
CGRectGetMinY(element.frame),
self.textView.textContainer.size.width,
CGRectGetHeight(element.frame));
self.textView.textContainer.exclusionPaths=@[[UIBezierPath bezierPathWithRect:exclusionFrame]];
But for some reason, if the width of the exception path is equal to the width of the textView, the text below UIView(aka element) will disappear. When I reduce the width of the exception path by one, the text appears with a column with one letter next to the UIViewfollowing:
+----------------+
|------txt-------|
|a |
|d UIView |
|e |
|------txt-------|
|----------------|
|----------------|
+----------------+
Why can't I create an exclusion path from edge to edge and is there a way to overcome this predicament?