Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable clipping of "Selection Handles/Callipers" in UITextView

I'm having a hard time googling this one because I'm not sure what to call it but here's a screenshot.

ClippedBug

If you look carefully you'll notice the right selection handle is being clipped, making it near impossible to touch (if you really focus you can grab it).

I've disabled "Clip subviews" on the red UITextView and it still clips it

like image 993
vvMINOvv Avatar asked Jul 16 '14 21:07

vvMINOvv


3 Answers

In the implementation of FMProblemTableViewCell, you need to disable clipsToBounds for _messageContent. That's the view that is clipping when I try your sample code.

- (id)initWithString:(NSString *)string {
  self = [[[NSBundle mainBundle] loadNibNamed:@"outgoingStringMessage" owner:self options:nil] objectAtIndex:0];
  _messageContent.text = string;

  //corners
  _messageBubbleView.layer.cornerRadius = 5;
  _messageContent.clipsToBounds = NO; // <--- this is what fixed it
  return self;
}
like image 151
MattP Avatar answered Nov 02 '22 04:11

MattP


Add some top & bottom inset to your text view's text container.

textView.textContainerInset.top += 4
textView.textContainerInset.bottom += 4
like image 1
ma11hew28 Avatar answered Nov 02 '22 03:11

ma11hew28


I had the same issue and was able to fix it by explicitly setting clipsToBounds to false programatically. If you disable it via Storyboard and inspect the view, you'll see it's not actually disabled. This is very odd behaviour, maybe it's a bug on Apple's side?

self.textView.clipsToBounds = false
like image 1
Kymer Avatar answered Nov 02 '22 02:11

Kymer