UIViewAnimation导致枚举类型隐式转换
收到此警告
从枚举类型“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 中的代码,有人知道如何“显式”转换吗?
TIA
I'm getting this warning
Implicit conversion from enumeration type 'UIViewAnimationCurve' to different enumeration type 'UIViewAnimationTransition'
from the last line in this code
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];
I'm adapting code from StackScrollView, any know how to "explicitly" convert?
TIA
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您正在使用一组不同的枚举:
当您使用其中一个 UIViewAnimationCurve 时,您必须在其中放置一个 UIViewAnimationTransition:
它们仍然都是整数,但来自不同的常量组
you are using a different set of enum: there you must put one of the UIViewAnimationTransition
while you are using one of UIViewAnimationCurve:
they are still all integer but from different groups of constants
所有枚举都是整数。
您调用的方法采用
UIViewAnimationTransition
。您将其设置为 UIViewAnimationCurve 定义的值之一。
All enums are integers.
The method your calling takes a
UIViewAnimationTransition
.you're setting it to one of the values defined by
UIViewAnimationCurve
.