0
votes

I have several buttons with images assigned to each. In Xcode 4.6 using the iOS 6 SDK, they show like they should. When using Xcode 5 with the iOS 7 SDK, the images are not there. In the xib it says an image is on the button but it doesn't appear. Any ideas why?

iOS 6: enter image description here

iOS 7: enter image description here

3
Did you set tint color of your buttons? - johnMa
The images you have attached are they screen dumps of the XIB or the running app ? Is it showing question marks on the xib ? Are you changing or setting the images programatically ? - Ryan Heitner
@johnMa, the color showing in Xcode 5 is the default tint color. - raginggoat
Try set tint color clear color. - johnMa
Use this code for set image UIImage *firstimage = [[UIImage imageNamed:@"notificationselected.png"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; - Pradhyuman sinh

3 Answers

3
votes

For me, my problem was that the button type was set to System instead of Custom. They displayed fine in iOS 6.0 and iOS 6.1 Simulators, just not iOS 7.0 simulator. I'm not sure how this happened as I'm pretty sure it's the first time the project had been opened in Xcode 5 with iOS 7.0 sdk. I had three buttons, 1 showed fine because it was a Custom button, and the other two did not show their images, but could be pressed. Once set to Custom button types, all worked great, as expected.

0
votes

I was able to get the images to appear after setting the tint color to clear and setting the image and background image to what I wanted. In Xcode 4 I didn't have to change any of that and I didn't have to set the background image, just the image.

0
votes

yes it is iOS7 issue.

Set bottom margin of the image/label through autolayout then try this code in your viewDidLoad and this should work.

if ([self respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)])
{
    [self prefersStatusBarHidden];
    [self performSelector:@selector(setNeedsStatusBarAppearanceUpdate)];
}
else
{
    // iOS 6
}