按数字访问typedef枚举?

时间:2013-07-24 13:00:38

标签: enums typedef uiviewanimation

我想通过相应的号码访问UIViewAnimationTransition(请参见图片,编号1)。此外,第二个数字对应于什么(图像,数字2),它与访问第一个数字有关。下面是这样的,其中选项被快速定义,然后例如进入动画块。

UIViewAnimationOptions option = 3; //  UIViewAnimationOptionTransitionCurlUp    

    UIImage * toImage = [backgroundImages objectAtIndex:backgroundImageCount];
    [UIView transitionWithView:backgroundView
                      duration:transitionDuration
                       options:option
                    animations:^{
                        [backgroundView setImage:toImage];
                    } completion:nil];

enter image description here

1 个答案:

答案 0 :(得分:1)

这些是位移值。例如,1<<20等于1048576。如果需要,您可以在Spotlight中计算它们

enter image description here

那就是说,你不应该用他们的数字来引用它们。