0

読み込み を表示するために次のコードを使用しましたが、animated gif正しく機能していないようです。NSArray は一連の画像とともに正しく読み込まれ、最初の画像が読み込まれますが、アニメーションは発生しません (画像が異なります)。誰かが私の間違いを指摘できますか?

.h ファイル

@property (強力、非アトミック) IBOutlet UIImageView *loadingGif; .m ファイル

@synthesize 読み込みGif;

...

[loadingGif setAlpha: 1];
NSArray *imageArray = [[NSArray alloc] initWithObjects:[UIImage imageNamed:@"g0.png"], [UIImage imageNamed:@"g1.png"], [UIImage imageNamed:@"g2.png"], [UIImage imageNamed:@"g3.png"], [UIImage imageNamed:@"g4.png"], [UIImage imageNamed:@"g5.png"], nil];
loadingGif = [[UIImageView alloc] initWithFrame:CGRectMake(435, 441, 152, 14)];
loadingGif.animationImages = imageArray;
loadingGif.animationDuration = 1.5;
loadingGif.contentMode = UIViewContentModeScaleAspectFill;
[loadingGif startAnimating];
4

1 に答える 1