Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIView with rounded corners, but content is not rounded

I have a UIView, inside this UIVIew I have an other view that has almost the same size as his parent. The parent view needs to have rounded corners, and that works, but the content is not being rounded. Is there a way to wrap the content or something like that?

To round the corners of the parent view this is what I'm doing:

#import <QuartzCore/QuartzCore.h>

self.boxView.layer.cornerRadius = 10;

Here is little sketch of what I'm talking about... (I think this is going to be more self-explanatory)

enter image description here

Thanks!

like image 740
Andres Avatar asked Aug 31 '25 10:08

Andres


1 Answers

self.boxView.clipsToBounds = YES;
like image 127
shanegao Avatar answered Sep 02 '25 23:09

shanegao