Tuesday, December 17, 2013

Problem switching between the two view

view1 switch to view2, and then switch back view2 view1, although the content view of the result is loaded again, but also the content of the original load still, the question is how it is every time you load the first time you load the contents of no situation, seeking guidance
Reply:
You are using a push / pop it
Reply:
I am also a novice

Switching view1
It [view2 removeFromSuperview]
Then [view2 release]
What is this?
Reply:
It is used in the navigation controller? How is that with the push / pop Shihai impossible to switch the view to retain the original content, all should be overwritten, which is level dictates. If this is also the view controller itself with the following two: [self presentModalViewController: self.childViewController animated: YES]; This is a view of the next turn, [[self parentViewCotroller] dismissModalViewControllerAnimated: YES]; This is to go on a view . You can try
Reply:
Not a navigation controller, thank the fourth floor of a friend, I would first try
Reply:
Since it is switched, the content will not change course, ah.
You have to load the effect is to remove it.
Navigation can be achieved. Either manually write code for it.
Reply:
How to manually write code? I would not approach the fourth floor, I view = nil; nor ah
Reply:
The reply was deleted at 2011-11-11 11:43:26 moderator

Reply:
Must show that you switch the view, or ViewCotroller, 3 floor, tell your approach is to viewCotroller viewCotroller way as the current display, the display is naturally viewCotroller of view if you just switch the display view in a cotroller the subview can not use that way up. However, they can write to view data reset methods to achieve the data initialization operation, call before you look like a display view.
Reply:
The landlord did not solve it? The controller in a single view, view1 switch to view2, you can set the frame attribute view1 into CGRectMake (0,0,0,0); view2 then switch back to view1, empathy.
Reply:
I am sorry, I have not run, the problem is solved, is to add a few functions to change the view of view, thank you ah

No comments:

Post a Comment