0
我正在构建一款名为旋转的益智游戏。旋转有一个3×3的数字,其中数字1-9,用户试图把数字按正确的顺序旋转其中的4个(一组)。所以在我的用户界面中,我有9个UIImgaeViews 4个按钮来完成集合的旋转。旋转益智游戏动画帧
在第一组图片的我有下面的代码做旋转的动画部分:
-(void)animateNumbers
{
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1.0];
//[UIView setAnimationDelay:1.0];
[UIView setAnimationCurve:UIViewAnimationCurveEaseOut];
CGRect pos00Frame = img1.frame;
CGRect pos01Frame = img2.frame;
CGRect pos10Frame = img5.frame;
CGRect pos11Frame = img4.frame;
img1.frame = pos01Frame;
img4.frame = pos00Frame;
img5.frame = pos10Frame;
img2.frame = pos11Frame;
[UIView commitAnimations];
}
我的问题是,当我随机所有的9号的比赛中,我不能做这个函数的旋转部分,因为我不知道该集合中的哪个图片。所以我的功能不能正常工作。在某种程度上,我必须知道哪些是&哪些是UI中的数字!我试图给他们加标签,但没有任何进展。有任何想法吗?