2012-03-29 5 views
1

UIImageViewsスライドを作成するにはどうすればよいですか?私はボタンと2つのUIImageViews両方のビューで、ボタンが押されたときに2つのUIImageViewsは、2つの側面からビュー上にスライドする必要があります。いくつかの体が私にスタートを与えることができますか?UIImageViewスライドオーバー

答えて

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は、どれくらいの時間がかかりますか。