Quantcast
Channel: OKWAVE 最新質問([技術者向] コンピューター/205)【本日】
Viewing all articles
Browse latest Browse all 38062

トランジションでフリップできない

$
0
0
iphoneアプリを作る勉強をしているのですが、どうにも行き詰まってしまいまして、 助言いただけましたらありがたいです。 ●やりたいこと 画像A→画像Bにフリップしてトランジット。 ●現状 いきなりフリップ後の状態になっていて、アニメーションしない。 ●開発環境 OS:Mountain Lion XCode:最新版 ●書いたコード -(void)configureView { NSLog(@"アニメーションが始まりました"); UIImage *img1 = [UIImage imageNamed:@"sample1.png"]; UIImageView *imgView1 = [[UIImageView alloc] initWithImage:img1]; imgView1.frame = CGRectMake(0, 0, 300, 300); imgView1.center = CGPointMake(160, 160); imgView1.alpha = 1; imgView1.hidden = YES; [self.view addSubview:imgView1]; UIImage *img2 = [UIImage imageNamed:@"sample2.png"]; UIImageView *imgView2 = [[UIImageView alloc] initWithImage:img2]; imgView2.frame = CGRectMake(0, 0, 300, 300); imgView2.center = CGPointMake(160, 160); imgView2.alpha = 1; imgView2.hidden = NO; [self.view addSubview:imgView2]; [UIView transitionWithView:self.view duration:1.0 options:UIViewAnimationOptionTransitionFlipFromLeft animations:^{imgView1.hidden = NO; imgView2.hidden = YES;} completion:^(BOOL finished){[self action];}]; } -(void)action { NSLog(@"アニメーションが終わりました"); } 何かしょうもないミスをしているだけだと思うのですが、 ド素人でして・・・よろしく御願いします。

Viewing all articles
Browse latest Browse all 38062

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>