uibutton去掉点击后背景有阴影的方法

 1,将normal和highlight两种方式都设置上图片即可

 

UIButton *goback = [[UIButton alloc]initWithFrame:CGRectMake(5.0f, 5.0f, 32.0f, 32.0f)];
                goback.backgroundColor = [UIColor clearColor];
                [goback setBackgroundImage:[UIImage imageNamed:@"tabbargobackbtn.png"] forState:UIControlStateNormal];
                [goback setBackgroundImage:[UIImage imageNamed:@"tabbargobackbtn.png"] forState:UIControlStateHighlighted];

 

2,设置button的    goback.adjustsImageWhenHighlighted = NO; 即可

posted @ 2014-04-22 14:38  如来藏  阅读(887)  评论(0编辑  收藏  举报