I saw Netease's thumb-up animation and imitated it to make a similar effect.
-(Void) zanaction {uilabel * onelbl = [[uilabel alloc] init]; onelbl. frame = cgrectmake (_ zanbtn. frame. origin. x, _ zanbtn. frame. origin. y, 35, 20); onelbl. text [email protected] "+ 1"; onelbl. font = [uifont boldsystemfontofsize: 17.0]; onelbl. textcolor = [uicolor colorwithred: 236/255. 0 Green: 93/255. 0 Blue: 114/255. 0 ALPHA: 0.8]; cgrect rect = _ zanbtn. frame; [_ zanbtn setimage: [uiimage imagenamed: @ "praised.png"] forstate: uicontrolstatenormal]; [uiview animatewithduration: 0.2 + 3 delay: 0 options: 0 animations: ^ {_ zanbtn. frame = cgrectmake (_ zanbtn. frame. origin. x, _ zanbtn. frame. origin. y, _ zanbtn. frame. size. width * 1.2, _ zanbtn. frame. size. height * 1.2);} completion: ^ (bool finished) {_ zanbtn. frame = rect; [uiview animatewithduration: 0.8 + 3 delay: 0 options: 0 animations: ^ {[self. view addsubview: onelbl]; // The upper and right movement of 10px increases to 1.2 times onelbl. frame = cgrectmake (onelbl. frame. origin. x, onelbl. frame. origin. y-25, onelbl. frame. size. width * 1.4, onelbl. frame. size. height * 1.4); onelbl. alpha = 0 ;}completion: ^ (bool finished) {[onelbl removefromsuperview] ;}];}
Core animation Study Notes (1)