马克思列宁主义揭示了,篮球之平凡王子,p50u20c
仿ios图标抖动
#import "lhviewcontroller.h" #define angeltorandian(x) ((x)/180.0*m_pi) @interface lhviewcontroller () @property (strong, nonatomic) iboutlet uiimageview *imageview; @end @implementation lhviewcontroller - (void)viewdidload { [super viewdidload]; // do any additional setup after loading the view, typically from a nib. uilongpressgesturerecognizer* longpress=[[uilongpressgesturerecognizer alloc]initwithtarget:self action:@selector(longpress:)]; [self.imageview addgesturerecognizer:longpress]; } -(void)longpress:(uilongpressgesturerecognizer*)longpress { if (longpress.state==uigesturerecognizerstatebegan) { cakeyframeanimation* anim=[cakeyframeanimation animation]; anim.keypath=@"transform.rotation"; anim.values=@[@(angeltorandian(-7)),@(angeltorandian(7)),@(angeltorandian(-7))]; anim.repeatcount=maxfloat; anim.duration=0.2; [self.imageview.layer addanimation:anim forkey:nil]; self.btn.hidden=no; } } - (ibaction)delete:(id)sender { [self.imageview removefromsuperview]; [self.btn removefromsuperview]; } @end
以上所述就是本文的全部内容了,希望大家能够喜欢。
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
iOS 使用UITextField自定义搜索框 实现用户输入完之后“实时搜索”功能
网友评论