0
I have a Uiviewcontroller with the black Background where would be my main Uiviewcontroller (where is the menu and etc) and I do this:
CredenciaisViewController *obj = [self.storyboard instantiateViewControllerWithIdentifier:@"Credencial"];
[_viewContainer addSubview:obj.view];
_viewContainer.alpha = 1;
Credentialviewcontroller has the red background and I carry it in a Uiview that is in my main Uiviewcontroller, but when it loads inside the view it turns half white and the Uibuttons when they are in the white part do not work.
Why does this happen? And how do I solve?
When I drag Containerview to the screen, it creates a connection with another Uiviewcontroller, I need that connection or I can dynamically call the Uiviewcontroller I want?
– Shumi
I inserted Container View into my Uiviewcontroller that has the Menu. E connected it to: @Property(nonatomic,Weak)Iboutlet Uiview *viewContainer; When you click on the menu I tried to load the contents in 2 ways. First form: Credentialviewcontroller *obj = [self.storyboard instantiateViewControllerWithIdentifier:@"Credential"]; [_viewContainer addSubview:obj.view]; Second form: Credentialisviewcontroller *obj = [self.storyboard instantiateViewControllerWithIdentifier:@"Credential"]; [self addChildViewController:obj]; .
– Shumi
Why not make the connection on own storyboard since all the elements you need are there?
– Paulo Rodrigues
Paulo, really is better, I did the storyboard and pressed, but he loads as soon as I run the project and not when I click the button, how do I make it not open face? Sorry, I’m starting with Ios!
– Shumi
Okay, in this case it really has to be something dynamic. I edited my answer, see if you can play.
– Paulo Rodrigues
Paulo, I was able to reproduce yes and pressed the content, but when I click on the screen (outside of any button) with the loaded content it flashes the screen and loads the content again, duplicating it. Why?
– Shumi
I managed to stop duplicating the contents, I did this: Nsarray *viewsToRemove = [self.view subviews]; for (Uiview *v in viewsToRemove) { [v removeFromSuperview]; } And stopped duplicating when I click on the background of the screen where there is no button, but when I click on the screen outside of any button blink, I would just like to take it off, the rest is perfect.
– Shumi
This is a strange behavior that I did not find here, see the example very simple that I did. In no time had this blinking behavior.
– Paulo Rodrigues