1

ダッシュボードアプリに見られる波及効果をiPhoneに持ち込もうとしています。私の考えは、レイアウト ビューにボタンを配置するたびに、ボタンの周りに波及効果があるはずです。ただし、ビュー全体に波及効果をもたらすことはできますが、効果が必要なのはボタンの周りだけです。どこで間違ったのかわかりません。次のコードを試しました。

LayoutButton *tempLayoutButton=[[LayoutButton alloc] initWithObject:object];
tempLayoutButton.center=copyImage.center;
[layoutView addSubview:tempLayoutButton];  
CALayer *templayer=[CALayer layer];
tempLayoutButton.layer.masksToBounds=NO;
templayer.frame=CGRectMake(0,0,50,50);
[tempLayoutButton.layer addSublayer:templayer];

CATransition *animation = [CATransition animation];
animation.delegate = self;
animation.duration = 1.0f;
animation.timingFunction = UIViewAnimationCurveEaseInOut;
animation.type = @"rippleEffect";
[templayer  addAnimation:animation forKey:@"animation"];
[tempLayoutButton release];
[tempLayoutButton.layer addSublayer:templayer];

templayer を LayoutView レイヤーに置き換えると、ビュー全体から波及効果が見られます。誰か解決策を教えてくれませんか

前もって感謝します

4

1 に答える 1

1

applesメーリングリストの1つで答えを見つけました。アニメーションはアップル独自のアニメーションであり、誰も使用できません。また、アニメーションが画面に正しく表示されることを保証するものではありません。同じタイプのアニメーションが必要な場合は、レイヤーを操作してアニメーションを取得する必要があります

于 2010-11-08T03:38:30.710 に答える