Xavi Valero
Xavi Valero

Reputation: 2057

UIViewController disappears while loading a UIView

I have a presenetModalViewcontroller on which I add a viewcontroller. When I click a button on that viewcontroller I need to load a view. Right now I am a loading a transparent view on the before mentioned viewController. But as I load the view, my viewController behind it shows a blank view.Its as if the viewController has disappeared. I cannot find a solution to what is happening. Any help will be appreciated.

Upvotes: 0

Views: 115

Answers (2)

Xavi Valero
Xavi Valero

Reputation: 2057

I was loading the view in an incorrect manner. This code worked

[[NSBundle mainBundle] loadNibNamed:@"NewView" owner:self options:nil];
[self.newView setFrame:CGRectMake(0, 0, 320, 480)];
[self.view addSubview:newView];

Upvotes: 0

Alastair Stuart
Alastair Stuart

Reputation: 4185

Your new view more than likely has an opaque background. Set the UIView's 'opaque' property to 'NO' and its backgroundColor to [UIColor clearColor].

Upvotes: 1

Related Questions