Reputation: 5711
Upon a certain user action, I wish to add to my UIViewController another UIView that will be half transparent; i.e. when it loads, the UIViewController view in the back will still be visible in the background, and the new UIView will appear as a layer above it.
The "Half Transparent" UIView should have several images and buttons in it, so I prefer to create a separated h, m and xib files for it so I can control it.
How should I do that?
Upvotes: 0
Views: 1804
Reputation: 18670
[[NSBundle mainBundle] loadNibNamed:@"NibName" owner:self options:nil];
Once this is done, your custom will be loaded from the nib and assigned to the property you declared.
Upvotes: 2
Reputation: 2523
Try this:
UIView *view = [[UIView alloc] init];
[view setAlpha:0.5];
[mainview addSubview:view]
Upvotes: 4