Is it possible to fix an iPhone app for iOS6+7 and 3.5 + 4 inch displays without editing code? - iphone

At this time I'm trying to edit an app of mine to support iOS6+7 aswell as 3.5+4 inch displays.
However I'm trying to do this without changing the code. And it works fine...for one of my requirements.
First I tried fix the 3.5/4 inch display issue with autolayout/contraints. It worked well but either it looked good with iOS6 or iOS7. And I didn't find a way to fix the iOS6/iOS7 diffrence without adjusting tons of code.
Then I resetted my contraints, disabled autolayout and fixed the iOS6/7 issue via offsets (iOS6/7 Deltas). Worked fine too for resolving the other requirement.
Since you can't use offsets AND autolayout at the same time I'm wondering if it's not possible to fix both problems without either checking iOS version or display size in my code?
I didn't provide code or screenshots because it's a more general question and I'm trying to solve this issue without touching my code. However what I can say is that I'm using .xib files to create the views not knowing if that's a problem too...
Thanks in advance,
blaluma

if your using storyboard with autosizing you can achieve that one

Related

xcode 8 auto layout uiimageview problems

I have a Android background and now try to code for iOS.
I use Swift as the language and it works really good so far. Now I am getting some troubles to get my layout to work on different screen resolutions that means different iPhones.
I am using storyboards for my ViewController and for now everything worked well except getting UIImageViews to look the same on each iPhone.
I tried now for 2 whole days with dozens of different approaches to get my layout work, but without any success. If I place a single UIImageView on my layout I am able to set the constraints so that it looks the same on each iPhone. Once I place a UIImageView on top of my first UIImageView it destroys everything. I won´t tell you here what I already tried, because it was a lot and nothing worked for me.
I need really some hint or just someone who could just try it on his Storyboard and tell me how he achieved it to get it work. I am using Xcode 8.2.1.
This is how it should look like (iPhone 7):
This is how it looks on a iPhone 4s --> wrong! Proportions are not the same!
It's need more params and maybe UIStackViews.
https://github.com/OMGHaveFun/exampleAutolayout

XCode 6 Storyboard UI depiction does not translate to what's seen in simulator

I'm currently learning Swift as well as XCode 6 and have been following this tutorial on creating a Tip Calculator. I believe I have followed the tutorial on point, since I have downloaded the example project file and compared it to my own and don't see any differences.
However, whenever I run the iPhone simulation on the provided example project compared to my own project, there's a striking difference in how the content is displayed on the simulator vs. the storyboard - things get cut off, don't appear, wrong location, etc.) :
-how the storyboard looks like --
I searched through Stack Overflow and have tried the following - cleaning the rebuild folder, 'resolve auto layout issues', unchecking 'auto layout', refreshed constraints in order to insure that it was running the correct files after editing. Those helped adjust the simulation to look as close as possible to storyboard, but now I am not sure what to do. I also tried changing the width to 'compact' and kept height to 'any' but still to no avail.
And it doesn't seem to be just this project, any project I create using storyboard - even as simple as dragging and dropping labels doesn't seem to correlate properly. I feel like I'm missing something stupidly fundamental, but I can't figure out what.
So my question is as an XCode newbie -
1.) What is the purpose of keeping the simulation to all 'inferred' size/orientation/etc. if it won't translate properly to any of the different simulation types? - iPhone 6 looks quites different from the iPhone 4 simulations and more. Shouldn't the iOS's point system make what I do in storyboard dynamic so as to transpose properly onto any iPhone?
2.) Is there some specific action I should be taking to make what I see on the storyboard translate properly to the simulator?

IB z-order on simulator 6.0

Consider the above's IB objects listing. Siblings further down the list should be on top of the siblings listed further up when rendered on the screen.
Under Xcode 4.5.2, everything is ok if iphone simulator 5.1 is used. But for simulator 6.0 the map just covers everything. The same if using actual devices (phones) for testing.
Hope that somebody knowledgeable could help.
Please also add comments if you do not (or do) find such a problem on simulator 6.0. Chances are the problem is related to how my project is setup.
Update :
Have setup a new test project with iOS 6 map view myself. There seems to be no problem with z-order at all. So the problem could relate to my code. Unfortunately, quite a lot have already been written, there wouldn't be enough time to go over everything for the time being. I suspect that it has something to do with the rootViewController property. My project initially followed a older scheme in which rootViewController was not used ...
I dont know if that order is reliable at all -- in the past definitly not and I am not conviced it is today :D. (even though apple claims it :D)
see: IPhone Interface Builder: Z-Index, Z-order of a button, image, ui element, etc?
(the 3rd answer currently. 7 votes)
The problem is solved by calling Window's bringSubviewToFront method. But I believe a better and more proper solution can be found given enough time.

Problems with presenting views in Xcode

I hope you can help me with my actual problems with designing an iPhone-App in the latest xCode version.
Here´s what I find a bit strange:
I designed a new project with a Storyboard and a Navigation Controller. Then I placed Objects like UILabels, ImageViews and so on. No when I run the Project in the simulator (as well on the iPhone) I noticed the following: When the App loads all the in the View placed objects fall down from the top to take their defined place. It takes maybe the quarter of a second, but its clearly to see. It also happens on all other views initiated from the root view controller
So, what do I have to change that everything is at it´s fixed place without to fall down from the top at the start of the app?
I hope I described it good enough. Actually I have no idea what´s going on there. I hope you can help me to fix this "problem". I´ve written some small Apps before, but I´ve never noticed a behavior like this.
Got the solution: I´ve had to remove the animations on the main view... now it works proper! :-)

iphone table view scrolls to bottom when launch

I am following Chapter 5 in O'Reilly Learning iPhone Programming.
When I launch the app in Xcode, the list will scroll straight away to the bottom. When I try to drag the tableview upwards, it will go back to the last row when I release my mouse.
Unfortunately I am unable to post the codes since it has many sections.
Anyone has a clue what code might have caused this problem?
It is likely that the UITableView is actually extending off the visible screen. Use the debugger to check at runtime the frame of the table view. It is not scrolling because it thinks the content is fitting. Without seeing the code though, this is just an educated guess.
I grabbed the sample code for Chapter 5 from here: http://www.learningiphoneprogramming.com/pages/samplecode.html and I'm unable to duplicate your problem. Are you sure you didn't change any of the code? What is your Base SDK?