Custom transition between two UIViews

后端 未结 6 615
暗喜
暗喜 2020-12-17 01:55

I have two views \"A\" and \"B\". A floats in the middle of the window (it\'s not full screen). B, the view which will replace A, is full screen. I\'d like to write a custom

6条回答
  •  被撕碎了的回忆
    2020-12-17 02:54

    Try something like this. As long as A's frame isn't fullscreen to start with then the animation should just flip A. When you add a subview to a view in a flip transition then it is added to the back of that view, so view A's frame is the one you want to modify.

    [UIView beginAnimations:@"flipopen" context:nil];
    [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self cache:TRUE];
    [a addSubview:b];
    a.frame = b.frame;
    [UIView commitAnimations];
    

提交回复
热议问题