I'm updating my app for the iPhone 5. Now I've read the topics about setting the Autosize Property and I've done that.
My question is regarding some of my elements. The interface of the app is really simple. It uses a pre-defined apple background (no custom images), and has 4 labels and a Information Button.
Two of the labels are fine but the other two and the button are aligned with the bottom of the screen, but with Auto-Sizing it creates and 1/2 inch of background between them and edge of screen.
If there any way to make them stay at the bottom of the screen like that but without having to create a whole new view for iPhone 5, with them positioned right and them programmtically select it when needed, as that is a slightly too complex way for the sake of two labels and a button.
EDITED
Here is some screenshots.
Should look like this (iPhone 4S 3.5 Inch Screen)
linky
Does look like this (iPhone 5 4 Inch Screen)
linky
To get the expected behaviour while using Autolayout, in Interface Builder, you need to select the two labels in the bottom and then go to
Editor -> Pin -> Bottom Space to Superview
This will make sure that the bottom spacing is as expected.
Related
I am trying to use adaptive layout in Xcode 7.1 for iPhone app. I am using 3 sizes iPhone device 5.5, 4.7 and 4.0 inches. When I added a background UIImageview, it fits nicely on all 3 iPhone screens. Please refer attached screenshot. I did pin option to Add 4 sides constraints with 0 values. Background fits to all 3 iPhone sizes screen fine.
Now, I am trying to add a UITextview in all 3 iPhone sizes screen. Now, this text view doesn't fit properly in all 3 iPhone sizes screen
Please find the screenshot reference below. How to make this textview properly placed on all 3 iPhone screens just below Employee ID label?
Follow this image and set your constraints like wise....
You have to set constraints to fit textfield properly. Firstly you have to set size class before setting constraints to handle orientation. like size class with respect to device size in this screen shot size class RH/CW set for portrait orientation. And set set constraints to fit UITextfield
I am developing an iPhone app and I have a few sets of labels which is fetching data from an XML feed. However, initially I designed the app for the iPhone 5 (with the bigger screen) and when I change it to 3.5 inch retina, the labels are displaced as seen in the photos.
iPhone 5 4.0 inch label
http://i.stack.imgur.com/d4LXp.png
iPhone 4 3.5 inch label
http://i.stack.imgur.com/OPNpn.png
Thus when clicking on the toggle button for designing for 3.5 inch and then editing it, then the 4 inch retina design will be displaced. Does anyone know how I can overcome this issue? Thanks. I am obviously using the storyboard to edit the files.
Mikkel, it depends if you are using Autolayout or not. To check if it's enabled, go to the File Inspector (Command+Alt+1) and see if the checkbox Use Autolayout is on or off).
If you are not using Autolayout: you will need to configure the AutoResizing Masks. In order to do so, go to the Size Inspector (Command+Alt+5). Then, for each label, you set the left margin and the top margin as fixed (the red line, not the arrow).
If you are using Autolayout: in the same size inspector, configure correctly the constraints to left and top as fixed, and it should be fine.
I am using storyboard and xcode 4.6 for designing Iphone app. I have very complex viewscontrollers and some of the subviews(like scrollview's and autocomplete tablviews) have generated dynamically. When app build for iphone 4 everything works fine. But, when using Iphone(retina-4 inch) simulator, I noticed that there is space at the top and bottom of the screen and also some of the subviews (like scrollviews and autocomplete tableviews ..) misplaced and covering other subviews in that viewcontroller. I tried to search and found some are suggesting to design/load two xib files based on screen size. I have enabled both autoresize masks and autolayout, but still the problem persists.
How to design a single storyboard file that is feasible for both Iphone-4 and Iphone-5.
Reference:How to develop or migrate apps for iPhone 5 screen resolution?
Update attached screenshot:
Storyboard file
Thanks in advance...
use the button in the picture below to toggle between retina 4 in and 3.5 inch. use the autosizing tool under the size inspector on the top right to get views to position themselves correctly.
I am creating a simple calculator app, following the tutorials from Stanford - first assignment.
The actual content is not that relevant, the only issue is that I have a UIRoundRectButton in the storyboard, which displays a fixed text (like "sqrt").
When I run it in the simulator (iPhone 5, iOS 6) - the text in SOME of the buttons gets cut off.
Screenshots:
Any help?
It looks to me like you're designing on a 4 inch xib but running on the 3.5 inch simulator, Autolayout will be pinning your lower buttons to the bottom of the screen and they will be getting squashed. Try one of:
Running on the 4 inch simulator (device--> hardware menu)
Switch to 3.5inch view in the storyboard (the grey icon on the bottom with the triangles above and below it
turning off Autolayout (on the file inspector of the storyboard)
Defining your constraints properly so they are all relative to the top of the view.
Those tutorials were written before Autolayout and the 4 inch display. You probably just want to focus on the tutorial content at this stage, so the last option is probably too much, but I have a blog post here discussing editing constraints in IB.
Please uncheck "Use Autolayout" option under "Show the file inspector" for XIB.
I have an app that I can't update for the new size of the iPhone 5- basically it's built around the asset sizes I have, and there's no way to get updated assets. The app still works fine, but it has a solid white background, and the letterbox (the black bars at the top and bottom) is black, which is really ugly.
Is there any way to set the color of the letterbox to white?
Well, you could just have google searched it. "You cant!". But there is a workaround. All you have to do is just add a "Default-568h#2x.png" file. You app will fill the display. All you have to do now is just add a white graphic on top and bottom if the device is iPhone5.
No, there is no way to do that :) But, you could resubmit your app without using updated assets and support iPhone 5 screen. To achieve that, 1) you have to add iPhone 5 launch screen. 2) make your view and subviews resizable so that they appear on their places (No need to create separate nibs) 3) test with iPhone 5 (iPhone 5 simulator), and you are good to go ;) Good Luck!