How to position static buttons and iPhone 5 - objective-c

I am working on an app where i have 12 buttons and labels underneath on one of the views. They are placed on the storyboard directly. I want to make sure they will get properly repositioned in iPhone 5. The solution that i tried is just to deselect all the lines in the autosizing for all the buttons. Now when i try it on iphone 5 the buttons get resized. The problem if i stretch the storyboard and move the buttons they get messed up when running on the smaller screen. So i can only position them on the smaller screen and then it seems to work. The app does not rotate. I would like to know if this is a good solution or there is a better solution for this case. I would like for the app to support iOS 5+
Thank you!

If you want layouts to work with varying screen sizes, you should become familiar with the new constraint-based layout scheme in iOS 6. A WWDC video on the subject can be viewed at http://www.youtube.com/watch?v=Dkr9eKxlMAk&feature=player_detailpage.
Essentially, you're going to use the old struts and springs system for pre-iOS 5 and conditionally use the new scheme for iOS 6. (iPhone 5 won't run any iOS version prior to 6.)

Related

IOS - Migrating storyboard to Xcode 8 resize

I used to have a story board in Xcode 7.3, today I started migrating to Xcode 8 by hand because I want to clean some stuff in this version.
The problem that I faced is that in the storyboard when I change the device type the content of the view controller scene is not adjusted to the phone.
This is an example:
The above is the same size as the storyboard in Xcode 7.3, actually Copy & Paste the View Controller Scene.
When I change the size to the next device I get this:
Now I have a space in the right. I'm using Auto Layout.
So I don't know what changed in this version or what do I need to do in order to make my storyboard fits on all iPhones sizes.
What I would need to see is if I change to a bigger phone then everything will auto fit on the new screen. Thats the way was working with Xcode 7.3.
Any advice?

ios8 and iPhone 6 Plus Tab Bar Size

I am bulding an iOS8 app and i have noticed that on the iPhone 6 Plus my TabBars and Navigation bars are bigger than the stock Apple apps. I cant seem to find any documentation for this. How do i tell my top and bottom bars to resize for the bigger iPhones?
The screenshot below shows Maps next to my app. (Amended to show clock app instead.) I am pretty sure the clock app uses a TabBar Controller and not a toolbar as suggested below.
Do you have a proper Launch Image for the higher (#3x) resolution for the iPhone 6+? If you don't you're app is going to get scaled, which is probably why it looks bigger. Run your app with the debugger on an iPhone 6 Plus and look at the value of UIScreen.MainScreen.Scale. If it reports back "2.0", then you don't have a proper launch image for your app, the resolution is being scaled. Once you have the proper launch image, UIScreen.MainScreen.Scale should report back as 3.0.
As J2K said to you, your tab and navigation are ok. Apple Maps app uses searchbar at the top and toolbar at the bottom which are smaller. Don't waste time on this, ios will handle the size for this elements for you in all iphone sizes

Storyboard for iPhone-only application displaying iPad sizes?

I am following along with a tutorial on Lynda.com and I am using XCode 6, while the tutorial uses XCode 5, so perhaps this is the problem. I have created a tabbed application and set devices to iPhone but my storyboard file looks like it's displaying iPad sizes. Why is this? My storyboards for other projects are not displayed like that.
In Xcode 6 Main.storyboard is the single storyboard for all devices, no matter their screen size. Open the storyboard and you’ll see that it contains a single view controller, but of an unfamiliar size. Storyboards in previous versions of Xcode had to match the screen size of the target device. This clearly isn’t possible with the “one storyboard to rule them all” approach, so the storyboard is given an abstract size instead.
Please check this tutorial :
http://www.raywenderlich.com/83276/beginning-adaptive-layout-tutorial

Is there a different way to view the iOS Simulator in Xcode 5 / Am I viewing my button correctly?

So I'm doing the Ray Wenderlich tutorials on iOS, and I'm doing the button tutorial. When I run the app, I get something that looks like this:
I have two questions:
I often see simulators show up in the form of an actual iPhone and was wondering if that was possible, or if that rectangle is the only way to view it?
The reason I'm asking is when I connected the button to an action (It says 'Pressed!'). So, is it supposed to show up in the box (bottom right) only, or should it should up on the simulator itself- mimicking what the user would see on-screen?
Regarding your first question: Probably a problem with screen size. See also here How can I restore the iPad frame around iOS Simulator 5.1?
The output seen in the screenshot is produced with NSLog and won't be seen on the device. You need to add an UILabel or such and set its text.
In the Simulator menu, try selecting Window then Scale and go to 50%. The retina models are far too big on my screen. Also, the old iOS 6 simulator with standard iPhone did look like a real phone, so examples from a while ago will look different.
If you want to support iOS 6.x, you can load it into Xcode. From Xcode main menu, select Xcode and then Preferences, and go to the Downloads tab.

IOS reorganize graphics on rotation

I'm making an iPad application with 19 buttons which are alle graphics. They are aligned next to and underneath eatchother, like in a grid. In portrait mode they are displayed nicely (because that's how I've set them) but I don't know what settings I need to choose for landscape mode.
When the device turns to landscape I've got room for 4 columns in stead of 3 in portrait for instance.
How can I make the app automatically adjust they layout of the buttons when rotated?
Thanks
In iOS5.1 or older, you will need to do this in code. In iOS6, its possible you can use a UICollectionView - not sure haven't played with it.