Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
A year ago i created an iphone app with xcode 6, i addded the autolayout, everything works fine on iphone 5 and iphone 6, but earlier i created a new app which is a duplicate of the older app, i added also autolayout but nothing works normally on iphone 6, the size of images, buttons are small however i added the #1X and the #2x size. i used the sames ressources as the older app.
The difference between older app and the newest one is that before i use ModalViewControllers but now i use ContainerViewController and switching between views.
I did not understand from where it comes the problem.
This is a screen shot of older app on iphone 6
And This is a screen shot of the newest app on iphone 6
What can be the problem?
Thank you for help.
It is unclear from your question what your problem actually is (both screenshots look fine), but I guess your issue is that on the second one the elements are somewhat smaller in proportion to the screen, is that it?
If so, that's because the first one is running in iPhone 5 (4" screen) emulation mode, just scaled up to take more space on the larger screen, while the second one runs in native iPhone 6 mode. The views are actually the same size as on an iPhone 5, they just take less space in proportion to the size of the screen (that's the goal of a larger screen).
Check the SDK version the app is build against, as well as the presence of a Launch Screen XIB, I believe those are the triggers for switching to the native mode.
If you want (some) UI elements to be larger on larger screens, you can use height or width constraints with multipliers, but fonts are trickier, you'll need to handle that in code.
Related
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 4 years ago.
Improve this question
Since I have updated to XCode 9.3 all my popover views default to a width of 320. If I go back to XCode 9.2 everything is fine and the same popover views are shown with the regular width of 1024.
This happens in my main.storyboard at every ViewController that is used as popover. If I try to overwrite the width, it jumps back to 320 again. The other views are showing normal width at XCode 9.3. It feels like the new XCode version reduces all popover views to an iPhone default width?
Does anyone has any idea, how to fix this? My app is for iPad only app (not universal).
I don't see the problem here. Here's a demo in Xcode 9.3:
https://github.com/bvankuik/TestPopover
I have a similar problem in an iPad only app with a storyboard containing several UITableViewController based scenes with varying widths and heights. Before 9.3, these were created with widths matching the storyboard. Now they all arrive in viewDidAppear with size 375x667 if orientation is landscape and 320x480 if portrait.
The solution was as follows, I had not set the content size box:
This question already has an answer here:
How to efficiently use Autolayut and Auto-Resizing in same target?
(1 answer)
Closed 5 years ago.
I am working on new features (with Swift) on a legacy project ( Objective-C ) project.
Everything that I am receiving from designer (dimensions in points, font dimensions) put into storyboard or xib files got bigger in old project.
In SIMULATOR, here is an example with a uiview height and font dimension for iPhone 7
We tried:
Designer gives all dimensions in points. He is currently designing for iPhone 7/6. I am using in storyboard iPhone 7 view.
In a new project the correspondence is 1:1.
In the legacy project everything shows a little bigger.
What shall I search?
The iPhone 6 was introduced alongside iOS 8 and Xcode 6. As part of the introduction of the larger screen sizes, a legacy path was created that would allow older apps to run in a mode as if they were on an iPhone 4/5 screen size, simply scaling up the interface. This was intended to give app developers time to opt into the native, larger resolution of the iPhone 6 and 6 plus. In your question, I noticed this:
The larger battery icon is from your legacy app, while the smaller is from your brand new application. The contents of the status bar being scaled is a sure tell sign that the app is in this legacy mode. (Also, the interface often appears kind of fuzzy)
Therefore, I think your legacy app must have never adopted the launch screen storyboard or xib file that is needed to take advantage of the native resolution of the larger devices. To adopt it, you can see this answer.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I'm trying to figure out how to make all my elements such as my buttons and labels fit on every iPhone screen size, including the iPhone 6 plus, iPhone 6 and iPhone 5 as well as the other version of the iPhone 5. How can I make this happen? Let's say I have 3 buttons I want centered in the middle of the screen width-wise, one on top of another.
All the screens you listed are of the same type. Your app will look the same on all the screens of the same type, without extra work. However, that's not the end of the story.
There are really only two screen types for iOS. The first one includes all iPhones before and including iPhone 4 and iPads. Another type includes only iPhones 5+. You are supposed to support both types in your application. In fact, Apple will not let you publish an app that doesn't look good on both screen types - hence the requirement to provide screen shots for both 3.5' and 4' screens - which represent each type. In addition, you need to make sure the app runs fine on an iPad, even if you don't plan on supporting iPads specifically. All apps for iPhones should run on iPads but if the app is made specifically for an iPad it's not required to work on an iPhone/iPod.
What this means is this - if you use Storyboard with AutoLayout, emulating an iPhone 5+ screen type and dont define proper constrains manually you will literally loose bottom part of the screen without any errors or anything when the app is ran on an earlier iPhone (like, iPhone 4s which also got the iOS 8 update) or an iPad. It will just get cut-off.
You should use AutoLayout to define constrains between screen bounds and elements themselves. You have two options on how to handle difference is the screen height:
One or more elements have flexible heights to make sure they stretch to fill up extra spaces for iPhones 5+ while also looking fine on iPhones <= 4 and iPads. This will require you to define vertical space between the top of the screen, all elements from the top to the bottom, and the bottom of the screen. Define height constrains for elements you do not want to stretch. This is also the proper way to use AutoLayout with scroll views.
Or anchor one or more element to the top or bottom of the screen, and specify vertical constrains to elements below/above it. You will need to specify the heights for all elements if you want to do it this way.
Once you start specifying constrains manually on Storyboard, XCode will try and assist you by letting you know if it needs more constrains or you're good to go. Lack of warnings is a good indicator that you are on the right path.
Define constrains by pressing Crtl + Left Mouse click on an element, then drag the mouse towards the direction of constraint. You might want to do a simple tutorial to figure this out.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
After upgrading to xcode 5 then when I test my app on retina 4 inch screen, it misplaces some of the objects I've put in my app. I tried everything and only have one solution that may work but would be very annoying to do. It is the screen detection method. I really don't want to go through the hassle changing a lot of my code just so that it can be compatible with a 4inch retina, because I would have to rewrite a lot of code just for a 4inch retina display... Is there a way to make it so that everything could be stretched to fit to screen?
Two possible Solutions:
For all of your nib (.xib) files or Views if using Storyboard, select View and set Size parameter value as "Retina 3.5-inch Full Screen". But using this one will fix your app screen height to 3.5inch.
In Inspector-tab, for every view items like labels, buttons, etc, set "Autosizing" parameters to stretch, reposition, fix or flexible positions and sizes of items according to change in screen height.
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How to develop or migrate apps for iPhone 5 screen resolution?
My apps use standard Apple controls. Some of them are really simple (UITableView nested in a UIView) and others are UITextView inside a UIScrollView inside a UIView
When I run the apps on my new iPhone 5, they are letterboxed. How do i update them to take advantage of the new iPhone 5 real estate?
First of all to remove the letter boxing, you let xcode know it should work on the iPhone 5 by adding an iPhone5 sized startup image which will be named Default-568h#2x.png
Straight away, your app will work without the letter box.
Then you need to move onto formatting your views to fit. From experience, every UITableView i've had has automatically resized to be longer, but most other views needed some tweaking of the Struts and Springs.