IPhone Content Change UIView / Sub view

I am trying to do the following:

Modify the contents of a UIView or Subview using UIButtons or a toolbar. I have a view as shown in the image below. I want to change the contents of the subsection "UIView to swap" by clicking on buttons or buttons on the toolbar. So you press button 1, and the view is loaded into "UIView to swap". Does this make sense? Can anyone suggest any tutorials? I know how to do this with images, but I want to change more complex views.

alt text http://yesimarobot.com/images/swap-uiviews.png

+3
source share
4 answers

. :

1) UIView, . UIView . .

2) UIView, . NSArray. viewArray

3) IBAction. ( ), , subview [viewArray objectAtIndex: myIndexFromButton].

4) . , , , , .

+2

, , true, , .

CAT- (, fade, push, move ..). .

, , , .

CATransition :

// Create a transition
CATransition *transition = [CATransition animation];
transition.duration = 0.25f;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionMoveIn;
transition.subtype = kCATransitionFromRight;
transition.delegate = self; 

// Add the transition to the content view layer
[self.view.layer addAnimation:transition forKey:nil];
+1

. UIView replaceSubview:with: ?

, 4 - / .

0

, 4 viewcontrollers 4 . , , .

(You basically reinvent the apple UITabBarController, which also uses viewcontrollers)

0
source

Source: https://habr.com/ru/post/1733104/


All Articles