Matt Shank
Matt Shank

Reputation: 158

I added UIButtons to my app and made custom images for them, but when I run the app in the simulator, my buttons are severely stretched

This is what the storyboard looks like in Xcode

Screenshot of storyboard in Xcode

This is what it looks like in the simulator

Screenshot of iOS Simulator

Does anyone have any idea why this may be happening?

Upvotes: 0

Views: 84

Answers (3)

Matt Shank
Matt Shank

Reputation: 158

I deleted the buttons and re-added them, and now it's working well. Thanks for the insights.

Upvotes: 0

bvogelzang
bvogelzang

Reputation: 1415

Check that the autolayout constraints for each button are setup properly. i.e. your top left button should probably have a constraint for its width and height and should pin its leading and top space to its superview.

Contraints

Upvotes: 1

Casey
Casey

Reputation: 19

Try resizing your images to the frame size of your UIButton and generate an @2x copy for your retina display. You can also try setting the mode to aspect fit in the attribute inspector.

Upvotes: 0

Related Questions