I am working with a UITableViewCell. The cell contains a number of images, a label, and a UITextView. I want the UITextView drawn with the other views as its exclusion paths. So inside my class MyUITableViewCell, I have the following code inside the method awakeFromNib
.
UIBezierPath *image =[UIBezierPath bezierPathWithRect:self.animalImageView.bounds];
UIBezierPath *label =[UIBezierPath bezierPathWithRect:self.animalTitleView.bounds];
UIBezierPath *rating =[UIBezierPath bezierPathWithRect:self.ratingOfAnimal.bounds];
self.animalBioTextView.bounds=self.bounds;//resize textview to fill table cell; exclusions will come later
self.animalBioTextView.textContainer.exclusionPaths=@[image, label, rating];//apply exclusions
NSLog(@"Bezier path set");
None of this editing seem to have taken effect.
BWT: I declared the TableViewCell in the storyboard right inside the UITableView. Then I link the storyboard cell to MyUITableViewCell, and went from there. To clarify: everything works fine; except now that I am to customize the textContainer.
--UPDATE--
I thought my code sample show what I want to do, still here are some more explanations:
I want the textview to be contiguous with the TableViewCell on all sides. Since I could not accomplish this in the storyboard, I add the following line in the code:
self.animalBioTextView.bounds=self.bounds
since the textview is contiguous with the cell, then I should be able to "easily" use the bounds of the child views and pass them to the textView. But evidently the bounds are with respect to the children themselves. So how do I get the coordinates with respect to the UITableViewCell? which in my case is
self