Buttons sized incorrectly on iOS8, correctly on iOS7 - ios

I solved this before posting, but I'm sharing this anyway just in case it helps someone else.
I'm having a problem with certain buttons sizing incorrectly on iOS8. They are coming out too tall, too wide, and the label is vertically misaligned. Interestingly, though the button is x-centered on the signin view, it maintains alignment on the left side. I'm still building on Xcode 5/iOS 7 as we have some higher priority issues we need to get out and building against iOS 8 breaks more than this. Are there different constraints I can apply here?
I've included the background image slicing also. It is 66x87 px, but the button is getting sized to 72px tall, so I'm not sure it is be related or not.

The problem here was that I did not have an #2x image for the button background. The button background is just a flat color so there was no real need for an #2x before.

Related

container proportions swift 4

I need clarification on how the container view in Swift 4 is supposed to work. I was under the impression (maybe falsely so), that if I set up all my labels, buttons, etc. inside of a container, set that container to zero for the left and upper constraints, centered it vertically and horizontally in the main view, and then pinned all of the fields within that container, then everything would be proportionally increased or decreased, depending on the screen size.
I designed my screens on a storyboard, using an iPhone 6 sized screen.
The App should be viewed only in Portrait mode, so I needn't worry about dealing with Landscape modes. I am finding out that the text fields within the container are keeping their sized fonts; when going to a larger screen (8 Plus), I am getting a large border on the bottom and right.
When going to a smaller screen (SE), most of the verbiage gets truncated. Have I misunderstood how this is supposed to work, or am I not doing it correctly?
I am almost ready to submit my first App to the Apple Store, but want to make sure that it will handle all possible sized screens. The 2 IOS courses I've been referring to are pretty vague on exactly how auto layout works. Also, I am getting over 24 warning messages that all of my fixed width constraints may cause clipping. (15 yard penalty?).
Hopefully, someone out there will have the patience to explain what I thought should be an easy thing to do. Here are screenshots of my initial view controller using each of the 3 sizes:
Originally Designed Screen, set to iPhone 6
Screen set to iPhone 8 Plus
Screen set to iPhone SE
Many thanks in advance for helping us out,
Jones
Stack views are meant to do exactly what you are trying to do. Here is a version of your app that uses stack views to create the example below. There is also a link to the GitHub page with the code - feel free to use it, tear it apart, whatever. Good luck!
https://github.com/squarehippo/Baseball2.git

Issue with Safe Area - Fine on iPhone X, not on others

So I'm trying to update my app for the iPhone X (a little late to the game, I know), and I enabled safe area, and fixed (supposedly) all my constraints to match. It looks perfect on the iPhone X. But for some reason, on all other iPhones, it still accounts for the iPhone X's notch, despite Safe Area correctly displaying where the UI should start and end. I'm at a loss. None of the constraints in question are hard coded, I set them all to the "standard" value (or so I believe).
storyboard (first button is actually the talk bubble, which is just a static image, second is the paw print, which is an actual button)
messed up iPhone 8 (bubble and ui elements should be at very top and bottom)
Here's my storyboard file: https://ufile.io/35zvs
UPDATE: image for ercell0
You are using standard spacing for top and bottom for your Banner View with a required priority. try setting this to superView: 0 or safeArea: 0 and see if that corrects the issue for you.
The updated view:
Can you change ViewAs from iPhoneX to iPhone8, and attach an image?
Other iphones your are testing on are running iOS11 or older?
If running older versions, safe-area won't be able to help with the alignment. For pre iOS11, use the constraints you were using previously or Layout Anchors.

App Content not filling simulator window

Just having an Xcode issue that I'm sure is tied to some setting I can't find. Im my storyboard, my content fills the entire view (i.e a background image), but then when I run my app in the iPhone 6 simulator, the background image and all the content don't fill the entire screen. There is white space to the right of and below the content on the simulated "screen".
When I run the app in the iPhone 5 simulator, this isn't an issue and it fills the entire simulated view.
So, what did I miss? I want to make my app work on all models of the iPhone.
Thanks for any help!
There are several ways to solve this, and I guess you are using View Size as Inferred or iPhone4 Inch in Attribute Inspector.
First way is to use AutoLayout at Storyboard to add Constraint.
If you don't want to use this, you should at least set the Autoresizing at Size Inspector.
"White space to the right of and below the content" sounds like there are scroll bars being displayed in your window. The iPhone 6 simulator is a different size, as well, which would account for them not being there on the iPhone 5 sim.
Have you tried going to the Home Screen (Shift + Command + H) in your simulator, and seeing if the white bars remain? On my computer, the white bars are always visible. Annoying, yes, but they don't cover anything or hide any part of the view. It's just a bit of white padding on two sides.

UICollectionView flickers thin "see through" lines between cells when scrolling

I have a UICollectionView with cells that are filled with a background image. The collection view has line spacing = 0.
This has been working perfectly well on iOS 6.1, but when tested on the iPhone 6 with iOS 8.1.3 I see thin "see through" lines appearing spontaneously between cells on collection view load, and then they are jumping around when scrolling.
So, how do I get rid of these lines?
I found a solution: make sure that all cells have "Clip subviews" unchecked. I guess this must be a bug, as the solution doesn't make sense, but it solved the problem.
EDIT* - This is actually caused by the app's deployment target being set as iOS7. When I switch to ios8, the problem goes away.
Sounds like you need to update your app to properly support iPhone 6/6+ screen sizes. One of my apps has this problem.
You'll need to go to your project settings and set a launch screen file so that it knows to show your app at actual size on the iphone 6/6+; otherwise, it will just show a scaled view of what one sees on the iPhone 5s.
I'm assuming this happens because the scaling from iphone5 to 6/6+ isn't exactly 1:1 pixel ratio. For example, because of imperfect scaling, a line at y:50 might be 1 pixel tall, but at y:51 it might be 2 pixels tall, which when scrolling causes a noticeable flicker.
I had the same problem, but it also happened on iPhone 4 with iOS7 (not only on iPhone 6 with iOS8.1). "See through" lines appeared between my section header and between the cells, some of them were permanent, others could just blink or disappear when I scrolled the view.
I could solve it expanding the background of my section header and cells by two pixels (in the bottom) and setting both views to not clip its subviews, as Lukas Kalinski suggested. Disabling clipping alone didn't work.
This worked for me, but it's kind of a hack. Not sure why iOS is presenting this behavior. I feel like we're still missing something.
I didn't try the suggested answer because I need to support iOS6+ and I can't stop using the iPhone 6 scale mode.
Check if the width and height of your collection view is an exact multiple of the widths and heights of your cells.

UIView not resizing correctly

For some strange reason, every new UIViewController I add into my project is not resizing according to the screen.
As you can see here in Xcode I'm using Retina 3.5 Inch Full Screen and it's supposed to look like this.
But in the iPhone the lower part of the screen is not being shown. This is what I see in a real iPhone 4.
As you can see, the button in the inferior part of the screen is behind that white bar and I can't click it.
I've really tried everything and I don't know what I'm missing.
I'm also tagging Objective-C as this could be cross platform.
I fixed the issue thanks to Luca. I was using a component for a Menu Bar that made the screen not to resize properly to 3.5 inch. Removed it and now everything works.

Resources