私は1つの画像ビューを持っており、他の画像ビューを設定して別の場所に配置しています。私はMAIPビューでFLIP ANIMATIONを適用したいと思います。どのようにそれを行うことができますか? if(i == 1)のとき、私のイメージビューが反転されます。 img1
は私のイメージビューであり、私はそれを識別したい。私はまだ特定ImageViewのを識別することはできません複数の画像ビューから特定の画像ビューを特定する
-(void)setCards
{
int k=0;
CGFloat dx = self.view.frame.size.width/2;
CGFloat dy = self.view.frame.size.height/2;
int cnt = [imagearr count];
for (int j=1; j<3; j++) // Number of cards
{
for (int i=1; i<5; i++) // Number of players
{
int rnd = (arc4random() % cnt)-1;
UIImage *img = [imagearr objectAtIndex:rnd];
UIImageView *img1 = [[UIImageView alloc] initWithImage:img];
CGRect frame = img1.frame;
frame.size.width = frameX;
frame.size.height = frameY;
[img1 setFrame:frame];
[img1 setTag:k+i];
[UIView beginAnimations:@"Move" context:nil];
[UIView setAnimationDuration:0.50];
if (i==1)
{
[img1 setCenter:CGPointMake(dx+100, dy+(j*15))];
}
if (i==2)
{
[img1 setCenter:CGPointMake(dx+(j*15), dy+60)];
}
if (i==3)
{
[img1 setCenter:CGPointMake(dx-130, dy-(j*15))];
}
if (i==4)
{
[img1 setCenter:CGPointMake(dx-(j*20), dy-95)];
}
[self.view addSubview:img1];
[UIView commitAnimations];
[img1 release];
}
k=k+10;
}
}
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch *touch = [[event allTouches] anyObject];
int t = [touch view].tag;
}
:私はimagearr `52の画像
私のコードを割り当てます。この問題を解決するために私を助けてください。
ここでは同じ質問を再入力することはできません。あなたの質問に注意を喚起したい場合は、2日後に[奨励金をかける]ことができます(http://stackoverflow.com/faq#bounty)。また、[あなたの質問を編集する](http://stackoverflow.com/posts/5854016/edit)で追加情報を追加することもできます。これにより、質問が理解しやすくなり、答えることができます。 – Will