の単純な 2 フレーム アニメーションを実行しようとしていUIButton
ます。プロパティを使用してこれが可能であることを理解していUIButton's
imageView.animationImages
ます-プロパティを配列に設定してアニメーション化します。しかし、そうすると何も表示されません。参考までに、buttonImages 配列を確認しましたが、実際に表示したい画像が含まれています。私が間違っているアイデアはありますか?
NSArray *buttonImages = bookDoc.book.buttonImages;
UIImage *bookImage = bookDoc.thumbImage;
UIButton *bookButton = [UIButton buttonWithType:UIButtonTypeCustom];
bookButton.frame = CGRectMake(0, 0, bookImage.size.width, bookImage.size.height);
//[bookButton setBackgroundImage:bookImage forState:UIControlStateNormal];
bookButton.imageView.animationImages = buttonImages;
bookButton.imageView.animationDuration = 0.5;
bookButton.imageView.animationRepeatCount = INFINITY;
[bookButton addTarget:self action:@selector(bookButtonPressed:) forControlEvents:UIControlEventTouchUpInside];
[bookButton.imageView startAnimating];