The effect is as follows:
ViewController.h
1 #import <UIKit/UIKit.h>23@interface viewcontroller: Uiviewcontroller4@end
Viewcontroller.m
1 #import "ViewController.h"2 3 @interfaceViewcontroller ()4 @end5 6 @implementationViewcontroller7 8- (void) Viewdidload {9 [Super Viewdidload];Ten OneUIButton *btnshadow =[UIButton Buttonwithtype:uibuttontypecustom]; ABtnshadow.frame = CGRectMake (0,0, -, -); -Btnshadow.center =Self.view.center; -Btnshadow.backgroundcolor = [Uicolor colorwithred:0.513Green0.894Blue1.000Alpha1.000]; theBtnShadow.layer.masksToBounds =YES; -BtnShadow.layer.cornerRadius =10.0; -BtnShadow.layer.borderColor = [Uicolor colorwithred:1.000Green0.572Blue0.894Alpha1.000]. Cgcolor; -BtnShadow.layer.borderWidth =2.0; + //Set Button caption font and shadow color -BtnShadow.titleLabel.font = [Uifont boldsystemfontofsize: -]; +BtnShadow.titleLabel.shadowOffset = Cgsizemake (2.0,2.0); A //set display characteristics in normal state at[Btnshadow Settitle:@"dot I auto flicker effect"Forstate:uicontrolstatenormal]; - [Btnshadow Settitlecolor:[uicolor Blackcolor] forstate:uicontrolstatenormal]; - [Btnshadow Settitleshadowcolor:[uicolor Graycolor] forstate:uicontrolstatenormal]; - - //tap to blink in normal and highlighted states -btnshadow.showstouchwhenhighlighted = YES;//The default value is no in - [Self.view Addsubview:btnshadow]; to } + -- (void) didreceivememorywarning { the [Super didreceivememorywarning]; * //Dispose of any resources the can be recreated. $ }Panax Notoginseng - @end
055 flashing effect when clicking a button