我收到了这个警告
从枚举类型“UIViewAnimationCurve”到不同枚举类型“UIViewAnimationTransition”的隐式转换
从这段代码的最后一行开始
if (((UIView*)[[slideViews subviews] objectAtIndex:0]).frame.origin.x > SLIDE_VIEWS_MINUS_X_POSITION) {
UIView* tempRight2View =[[slideViews subviews] objectAtIndex:[[slideViews subviews] count]-1];
[UIView beginAnimations:@"ALIGN_TO_MINIMENU" context:NULL];
[UIView setAnimationTransition:UIViewAnimationCurveEaseInOut forView:viewAtLeft cache:YES]; 我正在改编来自StackScrollView的代码,有谁知道如何“显式”转换?
提亚
发布于 2012-02-23 22:19:04
您正在使用一组不同的枚举:您必须在其中放置一个UIViewAnimationTransition
typedef enum {
UIViewAnimationTransitionNone,
UIViewAnimationTransitionFlipFromLeft,
UIViewAnimationTransitionFlipFromRight,
UIViewAnimationTransitionCurlUp,
UIViewAnimationTransitionCurlDown} UIViewAnimationTransition;当您使用以下UIViewAnimationCurve之一时:
typedef enum {
UIViewAnimationCurveEaseInOut,
UIViewAnimationCurveEaseIn,
UIViewAnimationCurveEaseOut,
UIViewAnimationCurveLinear} UIViewAnimationCurve它们仍然都是整数,但来自不同的常量组
发布于 2012-02-23 22:23:00
所有枚举都是整数。
您调用的方法需要一个UIViewAnimationTransition。
+ (void)setAnimationTransition:(UIViewAnimationTransition)transition
forView:(UIView *)view
cache:(BOOL)cache;您正在将它设置为UIViewAnimationCurve定义的值之一。
https://stackoverflow.com/questions/9414533
复制相似问题