Xcode - Button looks good in storyboard but not on

2019-08-10 00:12发布

问题:

When I work with buttons in the storyboard they look good, like this:

But when i run the app they turn out like this:

Do you guys know why?

Here are som settings:

Thanks!

回答1:

You might have put image in Image attribute of inspector. Put that image in Background attribute of inspector.



回答2:

top one in your attribute inspector Type, change that to Custom from Rounded. By the way, our iOS has simulator not emulator. In android sdk we call it emulator ;)



回答3:

check the view content mode in the attribute inspector it's in the fourth tab on your right colum. content mode can be scale to fill, aspect fit and a bunch of other possibilities. This will affect how it is presented. Check also in the fifth tab how your button autosizing is set.