2
我有以下代碼在視圖加載後被調用。它在iPhone上完美運行,但在iPad上似乎什麼也不做。我已經確認我的UIImageView的框架/界限被設置爲iPad屏幕的大小。建議請?交叉解決工作在iPhone上,但不是iPad
- (void)startNextAnimation {
CABasicAnimation *crossFade = [CABasicAnimation animationWithKeyPath:@"contents"];
crossFade.fromValue = imageFrom;
//crossFade.fromValue = (id)(imageFrom.CGImage);
crossFade.toValue = imageTo;
//crossFade.toValue = (id)(imageTo.CGImage);
crossFade.delegate = self;
crossFade.duration = 5.0f;
crossFade.fillMode = kCAFillModeForwards;
crossFade.removedOnCompletion = NO;
[bgPattern.layer addAnimation:crossFade forKey:@"animateContents"];
}