iOS Button添加阴影 和 圆角

 

用iamgeview 加手势代替

 

 self.headimageview = [[UIImageView alloc] initWithFrame:CGRectMake(IPHONEWIDTH(13), statusRect.size.height+IPHONEWIDTH(16), IPHONEWIDTH(119), IPHONEWIDTH(119))];

   

    self.headimageview.image=UIimageName(@"homeimages");

    //    阴影

    self.headimageview.layer.shadowColor = Colorgray.CGColor;

    self.headimageview.layer.shadowOffset = CGSizeMake(2, 2);

    self.headimageview.layer.shadowOpacity = 0.7;

    self.headimageview.layer.shadowRadius = 3;//阴影半径,默认3

    

    self.headimageview.userInteractionEnabled = YES; //响应点击

    UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(showLeftMenu)];

    [self.headimageview addGestureRecognizer:tapGesture];

    

    [self.view addSubview:self.headimageview];

 

 

 

 

 

 

-(void)showLeftMenu{

 

}

posted @ 2018-08-27 20:21  徐家汇  阅读(368)  评论(0编辑  收藏  举报