如何创建UIImageViews幻灯片?我在View的两个视图中都有一个按钮和两个UIImageViews,当按下按钮时,两个UIImageViews应该从两侧滑过视图。有些身体可以给我一个开始吗?
答案 0 :(得分:1)
[UIView animateWithDuration:durationOfAnimation animations:^{
CGRect imageView1Frame = imageView1.frame;
imageView1Frame.origin.x += 100 //or whatever number of pixels you want to slide them
imageView1.frame = imageView1Frame;
CGRect imageView2Frame = imageView2.frame;
imageView2Frame.origin.x += 100 //or whatever number of pixels you want to slide them
imageView2.frame = imageView2Frame;
}];
durationOfAnimation
在几秒钟内您需要多长时间。