2011-11-10 15 views
1

UIViewの境界線のフェードイン/アウトエフェクトを作成しようとしましたが、動作しません。 背景色に次の効果を出そうとすると、完全に機能します。UIViewの境界線の色をアニメーション化できません

[UIView animateWithDuration:3.0f 
      animations:^ { 

       [UIView beginAnimations:nil context:nil]; 
       [UIView setAnimationDuration:0.5]; 
       self.layer.borderColor = [[UIColor redColor] CGColor]; 
       self.layer.borderWidth = 1.5f; 
       [UIView commitAnimations]; 
      } 
      completion:^(BOOL finished){ 

       [UIView beginAnimations:nil context:nil]; 
       [UIView setAnimationDuration:0.8]; 
       self.layer.borderColor = [[UIColor whiteColor] CGColor]; 
       self.layer.borderWidth = 1.5f; 
       [UIView commitAnimations]; 
      }]; 

答えて

5

あなたはUIViewのブロックでのCALayerプロパティをアニメーション化することはできませんmy questionへの答えによると: は、ここで私が開発したコードです。

関連する問題