iOS開發(OC)——輸入框抖動效果

輸入錯誤時的輸入框抖動效果

CAKeyframeAnimation *shake=[CAKeyframeAnimation animationWithKeyPath:@"position.x"];
    shake.values=@[@0,@-10,@10,@-10,@0];
    shake.additive=YES;
    shake.duration=0.25;
    [view.layer addAnimation:shake forKey:@"shake"];
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章