Reputation: 399
Thanks in advance please forgive me if i am unable to explain the problem correctly.
By using xcode 4.6 i was successfully added image on the button but when i am trying display image on the button by using xcode 5.0.2 it not appears on the button properly .
Below is the code for where i am adding image on the button
[checkBtn1 setImage:[UIImage imageNamed:@"Checkmark_uncheckcheck.png"] forState:UIControlStateNormal];
[checkBtn2 setImage:[UIImage imageNamed:@"Checkmark_uncheckcheck.png"] forState:UIControlStateNormal];
[checkBtn3 setImage:[UIImage imageNamed:@"Checkmark_uncheckcheck.png"] forState:UIControlStateNormal];
[checkBtn4 setImage:[UIImage imageNamed:@"Checkmark_uncheckcheck.png"] forState:UIControlStateNormal];
This is how it looks:
Upvotes: 5
Views: 3942
Reputation: 6570
After seeing the screenshots, i think you are using roundrect button type put it custom and setBAckground image instead of setimage
UIButton * checkBtn1 =[UIButton buttonWithType:UIButtonTypeCustom];
[checkBtn1 setBackgroundImage:[UIImage imageNamed:@"Checkmark_uncheckcheck.png"] forState:UIControlStateNormal];
Upvotes: 13