2

enter image description here

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.

Alex Cio
  • 6,014
  • 5
  • 44
  • 74
Ghanshyam Tomar
  • 762
  • 1
  • 8
  • 24

3 Answers3

1

For this design put button in one view and set 5 pixel gap between view and button. Than set 2 pixel border of view.

Pramod Tapaniya
  • 1,228
  • 11
  • 30
1

set image through attribute setImage rather then setBackgroundImage, do UIButton backgroungColor clear color, and set border for UIButton

Yagnesh Dobariya
  • 2,241
  • 19
  • 29
1

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]];
Ghanshyam Tomar
  • 762
  • 1
  • 8
  • 24