splitviewController の最初の viewController で、テーブルcontentView
の に点滅アニメーションを適用しました。tableViewcell
私の問題は、SplitViewController のpresentsWithGesture
プロパティで FirstViewcontrollerを非表示にするとアニメーションが停止することです。
UItableViewCell をサブクラス化し、プロパティの設定中にアニメーションを追加し、以下contentView
のようにアニメーションを追加しましたcell
-(void)setProperty:(Property *)aProperty
{
_property=aProperty;
[self.contentView addSubview:self.dateLabel];
self.dateLabel.text=[self.meeting stringforScheduleDate];
if (_property.opened) {
CABasicAnimation *theAnimation;
CALayer *layer=[self.contentView layer];
theAnimation=[CABasicAnimation animationWithKeyPath:@"opacity"];
theAnimation.duration = 0.5;
theAnimation.delegate=self;
theAnimation.fromValue = [NSNumber numberWithFloat:0.0];
theAnimation.toValue = [NSNumber numberWithFloat:1.0];
theAnimation.repeatCount=HUGE_VALF;
theAnimation.autoreverses=YES;
// [layer removeAnimationForKey:@"opacity"];
[layer addAnimation:theAnimation forKey:@"opacity"];
}
else
{
CALayer *layer=[self.contentView layer];
[layer removeAnimationForKey:@"opacity"];
}
}
非表示のときにビュー階層のコア アニメーションを停止するのが ViewController の動作なのか、それともコードで何かを見逃しているのかわかりません。だから仲間を助けて