Reputation: 1537
Here are two component, UIView *superView, and UILabel *label. label is a subview of superView. The issue is that the label will be on top of the superView, when I move the label out of its super view. Did not the label be invisible if it is out of its super view's frame?
Thanks!
Upvotes: 1
Views: 344
Reputation: 4254
I hope that you have linked your label with your IB and used IBOutlet while declaring your UILabel. i.e in .h file
IBOutlet UILabel *myLabel;
link myLabel with the Label you created in IB. if you have done that
just use [myLabel removeFromSuperview];
it will work.
Upvotes: 0
Reputation: 54603
UIView
has a property clipsToBounds
. Setting it to YES
for your superView
will make all views outside of its bounds be clipped.
Upvotes: 2