0

I have 2 views and switching from view1 to view2 via a modal segue (full screen, cross dissolve).

When i go to view2 and go back to view1 using the buttons i defined, all the images in view1 are reseted back to their default values.

how can i prevent this?

lane1996
  • 13
  • 3

1 Answers1

0

here if you take 2 view in your XIB after that if you handle this view with button clicked event ,is very easy.... Means first take 2 view from xib after set your control on your view after when you click on butto the hide view1 and show view2 and so on... like...

if you want to use animation the its work like bellow....

-(IBAction)btnView1_Clicked:(id)sender{
[UIView beginAnimations:nil context:NULL];
        [UIView setAnimationDuration:1.0];
        [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:appDelegate.window cache:YES];
        [UIView commitAnimations];
       view1.hidden=FALSE;
       view2.hidden=TRUE;
}

-(IBAction)btnView2_Clicked:(id)sender{
[UIView beginAnimations:nil context:NULL];
        [UIView setAnimationDuration:1.0];
        [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:appDelegate.window cache:YES];
        [UIView commitAnimations];
      view1.hidden=TRUE; 
      view2.hidden=FALSE;

}

here you can hadle your view with this logic... hope,this help you.... :)

Paras Joshi
  • 20,427
  • 11
  • 57
  • 70