Black bars above and below on iOS simulator [closed] - ios

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I found a bug in Xcode 9 autolayout. My UIView with UITableView for iPhone 5s (568px height) get resized to iPhone 4 (480 px height). I don't understand why and how I can fix this bug?
As you can see, self.height for UIView is 416px without statusBar and NavigationBar (416+64 = 480px)
Inside the storyboard in the simulator for iPhone 5s iOS11, UITableView has height of 568px.
Why my application for iPhone 5s is shown as it was on iPhone 4.

Are you talking about the black bars above and below the view? This isn't an issue of how views are laid out. It's a more fundamental problem. See where the status bar (with the carrier and battery indicators) is. This status bar is not part of your view hierarchy, but it's not in the right place either. Bottom line, the entire window has been shrunk, not just the views in your app.
This is usually because of a lack of appropriate launch images (and is why we use launch storyboard nowadays). Either supply the missing launch images or shift to a launch storyboard.

Related

xCode 9.3 breaks popover view width [closed]

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:

iPhone 6 Autolayout issue [closed]

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.

View resizes in iPhone 6/6 PLUS (wrong size) [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
When switching to Xcode 7 i experienced some problems with iPhone 6/6plus screen sizes. I had an iPhone 4-sized view with black bars on top and bottom of it.
I read that i had to load appropriate launch images so I did it. The bars disappeared but the only views that scaled properly were the Tab bar and status bar (with wrong launch images i managed to fill the whole screen but the status bar was zoomed). The whole content stays 'windowed' and I don't know how to change it. Can anyone help me ?
You must use proper autolayouts Or Autoresizing Properties to make it look good on all the Devices.

UILabel doesn't show at the center on iOS Simulator (Xcode 6) [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I'm doing a tutorial where I have to change a label's text.
On the storyboard, I align my label's center, but when running on iOS simulator it goes to the bottom right.
I think it's because of the device that is set? On this tutorial it says to set to retina iPhone, but I can't find it.
I have iPhone 4s, 5, 6, and 6 plus, and and some iPads.
Can someone help me?
You need to learn about Auto Layout and more specifically how to set constraints so that your UILabel is at the center of any device running on iOS Simulator.
There is Ray's Video Tutorial on Auto Layout and the Beginning Auto Layout blog post for iOS 7. Maybe you give the rich Apple documentation a chance: Auto Layout Guide

Retina 4inch simulator is misplacing everything in my app [closed]

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.

Resources