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.
Asked
Active
Viewed 124 times
2

Alex Cio
- 6,014
- 5
- 44
- 74

Ghanshyam Tomar
- 762
- 1
- 8
- 24
-
1http://stackoverflow.com/questions/2315366/how-to-add-a-drop-shadow-to-a-uibutton may this help u – Yagnesh Dobariya Jun 19 '15 at 09:29
-
dude i tried this before didn't work for me.... – Ghanshyam Tomar Jun 19 '15 at 09:31
3 Answers
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
-
1Yes that was i thought(noobs thought this one too) but i want to use only one control i know this is done by the help of shadow or something in UIButton but don't know how. anyway thx for answer – Ghanshyam Tomar Jun 19 '15 at 09:49
-
That i don't know, If you know in feature than say me. Thanx in advance, and Welcome . – Pramod Tapaniya Jun 20 '15 at 04:38
-
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
-
hey dude you have the point you gave me clue i use same and use EdgeInsets for the clear space.+1 vote – Ghanshyam Tomar Jun 19 '15 at 09:59
-
or u can also design an image with outer border and set that image as a background image.....!!! – Yagnesh Dobariya Jun 19 '15 at 10:09
-
Yes our designer also said that but i want to create my-self i and i did it tnx for help. – Ghanshyam Tomar Jun 19 '15 at 10:11
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
-
-
1Welcome @Ghanshyam Tomar. or u can also design an image with outer border and set that image as a background image.....!!! – – Yagnesh Dobariya Jun 19 '15 at 10:12