輸入錯誤時的輸入框抖動效果
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"];
輸入錯誤時的輸入框抖動效果
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"];
#include 區分 #include <x.h>與#include "x.h"的作用 #include <x.h>:它用於對系統自帶的頭文件的引用,編譯器會在系統文件目錄下去查找該文件.