Work-around for deploying any:any size class to ios7? - interface-builder

I've created a very simple iphone app in xcode 6. I used the any:any size class. It looks fine when deployed to 5s devices with ios8. In 5s devices running 7.1, however, the app is sized for the smaller 4 and 4s devices with black bars at the top and bottom.
Is there a work-around for this? If not, then it seems like size classes (and IB?) are pretty unusable right now.

I did same with you and found some way out.
I tried this way:
Use the Launch Images Source Images.xcassets->Launch Image instead of Launch Screen File.
Then the size class worked with iOS 7.1 4 inch iPhone.
So, I think the LaunchScreen.xib is not worked with iOS version before iOS8, but size class is OK.

If your screen looks like this.
"with black bars at the top and bottom"
add a launch image with dimension 640x1136 named Default-568h#2x.png in your project
clean and build project and you will get desired result

Related

Xcode 6 simulator to device deformation

I updated to Xcode 6 recently and just started a new project. I made a project using storyboard and i was testing it in the simulator for the past days. Today i was testing the sound in the app and it wasn't working so i decided to try it on my iPod. This is what the app looks like in the simulator:
And now here is how it looks on my iPod:
I didn't use any constraints or anything. The only thing that could have messed it up IMO is the UIProgressView that i made bigger. I don't know if that could have deformed my project on device. Any suggestions to fix it?
ps: I was testing on the iphone 5 simulator and was using an ipod touch 5 to test on device.
Welp, i found the issue(s). The deformation was caused by Auto Layout being checked on. The black bars was solved here https://stackoverflow.com/a/25817683/3763526.

How to setup correctly iPad Launch Images in xCode 4.2 for both orientations

Ok. So I have iPad app in Xcode 4.2 targeted for iOS 5.1. I provided it with launch images for both landscape and portrait modes and it has some serious trouble with using them properly.
First in landscape mode it shows proper landscape image but rotated by 90 degrees CW and cropped on the right side. Then when it starts to display it properly but does it also in portrait mode (as if it doesn't recognize portrait mode at all anymore).
I've seen some suggestions like providing portrait image with rotated content for landscape mode, etc. but the problem is I can't for the life of me make xCode use both images in right moments.
Is there some voodoo for that? Like setting them in proper order, use plist directly or the slots in GUI, putting them in some special directory or two different directories, I don't know - anything? Fighting xCode over such things will make me puke with blood one day...
Ok, one thing to know is that xCode seems to be very capricious when it comes to updating settings, resources etc. I deleted references to the launch images from the project, cleaned the product in xCode and removed the app from simulator but it still somehow managed to use the launch images even though it didn't show copying the images in build log.
I'm not sure if it took the pictures from derived data or what but I had to delete derived data and remove the images manually from the app bundle in ~/Library/Application\ Support/iPhone\ Simulator/5.1/Applications/ to make it stop. Then I pasted the images manually into the app bundle and now after publishing both images work properly in the simulator ignoring the fact that I didn't set them up at all in xCode!
I'm still not sure how to proceed with the device version - it obviously doesn't have the launch images now...
Apparently xCode doesn't care at all about setting anything about the launch images apart from including properly named images in the project so they get copied to the bundle. As I wrote above you can even inject the images into the app bundle and it still works.
The other side is that once you get the images there it may by hard to get rid of them.
So anyway now I have nothing in my plist about the images, nor anything in the slots in the Target Info and I have four working launch images in my app (both orientations and retina).
Hope it helps someone sometime..

Tab Bar Icon display issue in universal app

I have an odd issue that's driving me nuts by now. Hopefully someone here can help me or ran into something similar. I've searched up and down but didn't find anything similar.
I am creating a universal app (Xcode 4.3.3) with storyboard including a UITabBar with 4 icons. The icons are from the free glyphish set, and look just fine in the iPhone simulator. In the iPad simulator, however, they look enlarged, and only about the top half is visible in the tabbar.
In addition to the original icon, I also created #2X, ~ipad and #2X~ipad versions (I did this for pretty much all art via batch in Photoshop). However, the icons look the same (i.e. too large) in the iPad simulator even when I remove these other versions and only keep the glyphish original.
I looked at the storyboard source code, I changed around a bunch of Tabbar and TabbarItem settings in the storyboard, nothing seems to help. HELP!
EDIT: I just noticed that the icons look fine in the iPad (Retina) simulator!?!?
SOLVED IT:
OK, solved it myself. Not sure which of these steps did it, but here's what I did:
delete the app from the simulator
Clean the Project
Recompile and Run
Now the icons display correctly. Go figure.
SOLVED IT: OK, solved it myself. Not sure which of these steps did it, but here's what I did:
Delete the app from the simulator
Clean the Project
Recompile and Run
Now the icons display correctly. Go figure.

iPad launch image is upside down (portrait) for landscape-only app regardless of rotation

I am developing a universal app. My deployment target is 5.1 I want it to run portrait-only on the iPhone/iPod, and in landscape-only on the iPad.
I am testing with the iPhone and iPad simulators, as well as the latest versions of the iPod touch and iPad.
It works as expected on the iPhone. The portrait launch image comes up first, then the app starts. No problems. It works fine on the simulator as well as my iPod. No matter what the rotation, the app starts and continues to run in portrait (bottom home button), which is as intended.
It works correctly in the iPad simulator. The landscape launch image comes up, then the app starts in landscape. Whatever the rotation, the launch image and the app start and run in landscape as expected.
However, on my iPad, the portrait launch image displays in portrait-upside-down, no matter which way the iPad is rotated. When I remove the Default-Portrait~ipad.png and Default-Portrait#2x~ipad.png files from my project, XCode replaces them with Default.png and Default#2x.png, which are for the iPhone--not the iPad, and which also launch upside down.
My InfoPlist includes these settings:
Initial interface orientation: Portrait (bottom home button)
(There is no key for Initial Interface orientation~ipad)
Supported interface orientations: Portrait (bottom home button)
Supported interface orientations~ipad:
Landscape (left home button)
Landscape (right home button)
I tried changing the Initial interface orientation to Landscape, and I tried removing that key altogether. Neither change made a difference in the way it ran.
I’ve now tried everything I can think of to make this work. Does anybody have a solution?
Thanks.
Okay, I finally fixed the problem. Seems like a bug in XCode to me, but I should have caught it.
I located all my image files in the "Supporting Files" folder. This was not a problem for my music files or most of my image files. However, when it came to my Default-Landscape~ipad.png and Default-Landscape#2x~ipad files, XCode did not like it.
I had dragged those files into their respective boxes on the Summary page, and they were accepted. Then I moved them from the top level folder to the "Supporting Files" folder--just like I had done with the Default.png and Default#2x.png files for the iPhone.
When I built the app, I got no errors. When I ran the app, I got no warnings.
However, HERE IS WHERE I WENT WRONG. I did not run the app with the Profiler until late in the game, and apparently even when I did, I must have ignored the two warnings. Finally, I noticed them: Icon specified in the Info.plist not found under the top level app wrapper: Default-Landscape~ipad.png. I had the same warning for Default-Landscape#2x~ipad.png.
So, I deleted those two files from my project. Then I dragged them into their respective boxes on the Summary page, just as I had done before. But this time I did not move the files from the top project folder. I ran a Clean. Then I ran the app.
IT'S FIXED.
Hope this helps somebody else. ;)
I had a similar issue and was able to fix this issue by changing the order of the supported orientations in the plist file to be [0]:LandscapeRight and [1]:LandscapeLeft

How to resize window and views when porting from iPhone to iPad?

I am porting my iPhone app to the iPad (I did a straight copy of the iPhone code, renamed it, and set the mainwindow.xib size to iPhone/iPod).
I don't see anything that will allow me to resize the newly renamed app to iPad. How do I do that?
Apparently it can't be easily done. I gave up and re-wrote the app.

Resources