Reputation: 770
i want this type of button
i have tried pictureBtn which is UIbutton
,i gave it a 5 pixel clear color corner radius and add a picture like camera below but last outer white line how to deal with this can anybody have ideas or something like control.
Upvotes: 2
Views: 144
Reputation: 770
This is my output code for my solution -
UIButton *picBtn = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, 60, 60)];
[picBtn setImage:[UIImage imageNamed:@"CM.png"] forState:UIControlStateNormal];
[picBtn setBackgroundColor:[UIColor clearColor]];
[picBtn setImageEdgeInsets:UIEdgeInsetsMake(10, 10, 10, 10)];
[picBtn.layer setCornerRadius:picBtn.frame.size.height/2];
[picBtn.layer setBorderWidth:2];
[picBtn.layer setBorderColor:[[UIColor grayColor] CGColor]];
Upvotes: 1
Reputation: 2251
set image through attribute setImage rather then setBackgroundImage, do UIButton backgroungColor clear color, and set border for UIButton
Upvotes: 1
Reputation: 1266
For this design put button in one view and set 5 pixel gap between view and button. Than set 2 pixel border of view.
Upvotes: 1