Widget “flip” behavior in Core Animation/Cocoa

前端 未结 7 1927
执笔经年
执笔经年 2020-11-30 02:31

I\'m trying to make a Card class that duplicates the behavior of Dashboard widgets in that you can put controls or images or whatever on two sides of the card and flip betwe

7条回答
  •  离开以前
    2020-11-30 03:27

    Probably not the case in 2008 when this question was asked, but this is pretty easy these days:

    [UIView animateWithDuration:0.5 animations:^{
        [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.iconView cache:YES];
        /* changes to the view made here will be reflected on the flipped to side */
    }];
    

    Note: Apparently, this only works on iOS.

提交回复
热议问题