4

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!

2
  • 3
    Have you tried self.view.layer.masksToBounds = YES? Or maybe self.view.clipSubview?
    – BooRanger
    May 20, 2013 at 14:47
  • Put the child behind the "parent" (both inside an owning view)
    – Hot Licks
    May 20, 2013 at 14:50

1 Answer 1

5
self.boxView.clipsToBounds = YES;
1
  • Thank you so much! It was easy, but as we say in our country: "He who does not know, is like he who does not see."
    – Andres
    May 20, 2013 at 17:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.