Xcode - Button looks good in storyboard but not on emulator - ios

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!

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

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 ;)

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.

Related

how to set image as background in launch.storybord + xamarin.forms

in recent release of xamarin launch screen can be designed from storyboard instead of old approach where we were adding all splash screen images according to wise.
https://developer.xamarin.com/guides/ios/application_fundamentals/working_with_images/launch-screens/
from this link get to know how can set launchscreen using storyboard.
so my question is how can i set image as background to storyboard dont want background colour.
i need image as background on which i can put logo image and label.
so is it possible?if yes then how.
please help.
You need to set top,bottom,leading,trailing constraints on the imageView.
Select Constraint edit mode ,and click twice to show the point on side which ca be dragged to set the constraint.
Modify the constraint value to 0(in Property menu).
Do the same work on the four constraints.
Refer to Auto Layout with the Xamarin Designer for iOS

Strange behavior of custom back button in IOS

I am trying to change default back button in IOS Swift to custom one. What I get is that
but should be that
How can it be fixed people?
In storyboard you can try using the "aspect fit" option or add aspect ratio to the button to make sure it has the correct scale according to the image.

UIButton is out of navigation bar

I have a custom UI Button (just regular button but with image), within the navigation bar, but when I choose my image it looks like this in designer:
As you can see here, it's over my provider and status labels, and also when I run application it's over the WebView (which is bellow), so definitely out of navigation bar. I tried to find in storyboard some property where I can adjust this but I couldn't find any. I'm using swift and storyboards.
Appreciate any help, iOS newbie :)
Based on your description I think your issue is that you are trying to add a button for navigation. What you need is a NavigationBar with a NavigationItem/BarButtonItem in it. If you look in the object library you will be able to find these.
Just drag them onto your story board. Once there select the button and in the side menu you will be able to select the Image for that Item. Now it is in the navigation bar up top. Let me know if there are still issues. 👱🏼
You have to make sure your 1x image is to the specified size (and then your 2x etc, or just use a PDF at the 1x size.
Icon sizes are here: iOS Human Interface Guidelines: Icon and Image Sizes
I made my pdf 22x22 and added it to .xcassets with scale factor "single vector"

Is there a way to view a storyboard scene without running the app?

Im working on an app with a viewcontroller buried deep inside a drill down. Im working with autolayout and would like to view my changes without having to go thru the rest of the app processes.
is there a way to view what a scene will look like onscreen without having to run the entire app?
There is a menu option called simulate document. Unfortunately, newer versions of Xcode no longer have this available for iOS apps, OSX only.
If you only want to see the effect of changing between 3.5inch and 4inch phones, or orientation changes, you can change the simulated metrics on the storyboard. This will show you how your ui elements will lay themselves out based on your autolayout settings. Anything you are doing in your code in your view controller won't take effect since you're not actually running anything. This will only show you results based on things you have set in the storyboard.
To do this, select your view controller on the storyboard and open the Attributes Inspector (Cmd+Option+4).
All of the simulated metrics are likely set to Inferred. You can change the size and orientation here.
Using this you can at least find some errors. Say I have a button at the bottom of the view, but I set the constraint to "Top Space To Superview" instead of bottom. When I change the Size Simulated Metric to the 3.5 inch, this button will be off the bottom of the screen.

Issue with autoresizing in iOS

I have an xib file with the image like this:
When I run it, it seems to downsize to this:
Width:320 Height:370 is the values I have given. There is a navigation bar above and a tab bar below.
Should the image show normally? it seems to be resized.. not sure why...
How do I avoid the shrinking?
Need some guidance.. Thanks...
*EDIT1 *
Huge apologies.. I am using iPhone(Retina 3.5 inch). that is why it is appearing on the middle. How do i ensure that it remains at the bottom for iphone(Retina 4 inch), iPhone (Retina 3.5 inch) and iPhone?
*EDIT2 *
in iphone 5, it looks like this:
How to avoid this?
please add bottom bar as tabbar in xib file ...
Open your xib and select your view then Uncheck the "Use AutoLayout" property from
File Inspector(Option+Command+1)
Select the image in the xib editor and set the mode to "top".
You need to set autoresizingmask of your view and imageview to UIViewAutoresizingFlexibleTopMargin if you want they stay bottom all the time.
And you need to remove UIViewAutoresizingFlexibleHeight.
You can do it with code or in interfacebuilder.

Resources