why are my picture background so big in simulator but not in the layout. ?!
i have try to change from iphone to ipad but my problem still there.
printscreen:
[IMG]http://i59.tinypic.com/15y9r4g.png[/IMG]
Xcode 6 provide the facility to automatically adjust views. In order to disable this you must uncheck this. Select Your View Controller and disable Use auto layout.
Related
As we all know, when you enter Preview in the assistant editor on a xib document, you are greeted with the "iPhone 4-inch" device. It is not possible to remove devices from the view once added. Has anyone researched a way to change the default device that appears? I can't imagine anyone designing with the 4-inch iPhone in mind. I really want to see 4.7-inch every time I use Preview. Further, suppose I was developing an iPad-only app.
You can delete a device by selecting it and click 'Delete' button from your keyboard (even first one created for 4 inch screen can be deleted). These changes are kept even after restarting Xcode.
Answer to your question is NO. There is no way to change this. A workaround would be to add the desired device, 4.7 inch in your case and delete default one. Next time when you'll preview your view you'll see the 4.7 inch device.
I have a Universal application in Swift 2.0 developed in XCode 7.
On the storyboard simulated metrics, I have the 'size' set to 'iPhone 4.7-inch'.
When I run the application on my device (iPhone 5s), none of the labels are aligned and the toolbar is out of view. -This is also the case when I run using the iPad device in XCodes simulator.
Image of what the view controller contains ...
From the snippet above, when I run this VC on my iPhone there is no margin on the right side, and the toolbar is cropped off.
Can anyone advise how I can make a universal application show all the content in the VC, on all devices. Or how I would simply show the toolbar ...
That's what auto layout (constraints) is for.
On the storyboard simulated metrics, I have the 'size' set to 'iPhone 4.7-inch'.
That's irrelevant, and indeed misleading, since in means that only on the iPhone 4.7-inch will your app look like the storyboard design — unless you use auto layout.
iPhones come in many screen sizes. Basically, you have no way of knowing, as you design, what the screen size will actually be! Auto layout is the solution. Auto layout allows your interface elements to adjust automatically as the app launches on a particular size screen. iPads can serve as an extension of this — i.e., just an even larger size screen — or you can even use conditional constraints to make the interface quite different on the iPad from the iPhone, if desired - all designed in a single storyboard.
Maybe you are using auto layout and auto constraint. You could deactivate this in opening the storyboard, open up right panel , go to "show the file inspector" section and under Interface Builder Document uncheck auto layout and auto constraint
Image here
Select your item view, go into "Show the size inspector" and there you can set your autoresizing for all devices
I choose 4.7-inch as the default layout in Storyboard to make prototype more easily. 4.7-inch is iPhone 6 according to this link on Apple website.
In Xcode Preview, it's ok to show the layout.
But in iPhone 6 simulator, the layout is inconsistent to Preview.
Is it a bug in Xcode's Preview? Thanks.
FYI, Auto Layout and Size Classes are enabled, but I haven't add any constraint yet.
If constraints are enabled in your storyboard, then add constraints to it to be sure your layout behaves as you expect !
I was making a user interface using storyboards and when I built my app to see how it would look in the iOS simulator it didn't look like the viewcontroller in the storyboard (some of the buttons were moved around and I had to move one button way down so it was in the place i wanted it to be). Does anyone know why this is?
Yes, the reason is auto layout, it will automatically position elements on a relative basis depending on the device you're running.
You can turn autolayout off, or build for all devices at once and keep it on.
You may want to read iOS Auto Layout Demystified by Erica Sadun which goes in depth to the world of autolayout.
I'm new to Xcode and I'm having a problem between interface builder and iphone simulator
As you see below, I set the imageview size for simulator, but some buttons places are changed, button texts disappeared or even buttons disappeared.
http://postimage.org/image/w9ej1c3z1/
I just open a new project and add buttons like the image below, then run the project. Same thing again! I'm doing something wrong?
http://postimage.org/image/6gl55tehd/
xcode version is: 4.5.2
Ios simulator version is 6.0
Please make validate your design by clicking on "Apply retina 4 form Factor" button at the bottom of view controller upon selection...
if you click on that button, It will change to simulator size and you can check the design
It looks like your view is for a 4" screen but you are running in the 3.5" simulator. You will probably just need to play with the autoresize a bit to make it work correctly.
Your interface builder is set for the resolution of an iPhone 5. Your simulator is on the resolution of an iPhone 4S. In the Simulator menu bar select Device -> Hardware - iPhone 5 (Retina) and you will see your additional buttons.
Here is a pretty good tutorial which explains how to support both the iPhone 5 and <= iPhone 4S screen resolutions. Working with iOS 6 Auto Layout Constraints in Interface Builder