Disable Orientation in iphone app. iOS 7 - Xcode 5 - ios

I created iphone and ipad app using Xcode 5, iOS 7.
My app contains UIViewControllers and UITableViewControllers. I want to stop landscape orientation in the whole app.
How could I do this?
Thanks in advance.

Check this image, it shows in the bottom where you can specify which interface orientation your target app will have. You just have to select Portrait and upside down.

Click on your projects name, under the "General" tab in the "Deployment Info" section, there's an option called "Device Orientation". Simply check portrait, and uncheck everything else.

Related

ios simulator won't stay horizontal even when landscape mode is ticked

I'm developing a swift project with XCode and I need my app to run only in landscape mode. I ticked the option like it shows here:
but still, when I launch the app the simulator stays in portrait.
I know i can rotate it with command + left or right but I'd prefer XCode to do that for me.
You have to set it too in your info.plist key Supported interface orientations:

Locking a project into portrait in Xcode?

I have just begun creating a new Xcode project, and noticed that how I normally remove the function to have the app in landscape; a tick box under device orientation within the general tab of the project; has disappeared.
Has this orientation setting moved elsewhere, or must I now code it to lock it into portrait only?
Also, I am working in objective-c.
Thanks.
Click on your project on the left menu, next uncheck Landscape mode in Device Orientation:

How to make an ipad app only portrait?

I am making an ipad app, and i set the the app to only portrait, but it still works in landscape? Why is this happening only on an ipad? How do i fix this?
Note: if the answer is in code, please write it in swift.
In xcode select your project. Go to Targets -> General, scroll down and you can select the Orientation as portrait only.
You can also make change to info.plist file to select proper orientations for Supported interface orientations (iPad)
In deployment Info section you can select your app orientation to support.

xcode only running 3.5 inch screen [duplicate]

We have an iPod app built with base SDK as 5.1.
App has a tabBarController with three tabs and each tab has a UIViewController to load a different view.
The app works fine for iOS 6.1 and iOS 7 (3.5 inch display) simulator and device but when we run the app on
iOS 7 (4 inch display simulator) or device we are getting black bars at the top and bottom of the view screen in all three tabs.
If anyone can suggest reason for this or some feasible solution to this problem, it would be really helpful for us.
Thanks
First thing is that you must add the required default image for 4 inch screen display. Check Properly in you project have image with name Default-568h#2x.png (640 × 1136 pixels)
This Default-568h#2x.png is Necessary for Support app in 4 inch Screen display
Ones you add this image in to you working Project, Remove old Build from device or Simulatore, clear Project and re build and check Hope you issue will solve.
Edit:-
After fix the black Bar issue you can check the device like my answer Give here check this:-
Detect device type
you have two choice if you can't use AutoLayout
First
Create two xib with same class one for 3.5 inch screen and one for 4 inch screen set using macro with checking which screen appear.
Second
Set Self.view frame using macro with checking which screen appear.
There are also other methods you can use for set self.view frame as using window frame or UIScreen
My problem was I accidentally deleted the value found here:
I added back LaunchScreen, and made sure there was a LaunchScreen.xib. Maybe it will help some others.
Ive had the same problem - black bars at the top and bottom. It was simply solved by setting the drop down in "App Icons and Launch Images" to Main_iPhone:
App Icons and Launch Images Screen Shot
I was facing same problem . I just added launch image and it worked for me.
XCode->Click on Project File -> Select Target-> App Icons and Launch Images -> Add launch image source
This worked!
Pay attention to Step#5 and Step#6 below:
1.In xcode, Click on the Project file in Project Navigator
2.Click General tab
3.Type "Main_iPhone" in the Launch Screen File field
4.Save
5.Remove the app from device or simulator
6.Then in Xcode go to Product Menu and then select Clean
7.Build again

iOS Simulator Ignores Half of the Screen?

My app is working fine in iOS 7 , but when I simulate it in iOS 6 simulator , it seems , that it only loads top half of the screen. How can I solve this ?
This is an screenshot of how the view is in the storyboard builder and in the simulator :
set your iPhone retina 4 launch image 640*1136
You have to add a splash screen (Default.png) of (640 × 1136)... without this app treated app as its iphone 4s & below device
You need to set the UI for iOS7 as well as iOS6.
Just open your storyboard and then click on assistant editor.
Now open storyboard preview in assistant editor.
There is a button in assistant editor at right hand bottom corner which says iOS7 or later, click on it and select iOS6 or earlier.
Now you can see the UI for both iOS7 and iOS6 side by side on the screen.
Now select a particular view controller and then select size inspector.
In size inspector you just need to set the iOS6/7 Deltas for iOS6 screens.
That's it.
check this url too :
https://developer.apple.com/library/IOs/documentation/UserExperience/Conceptual/TransitionGuide/SupportingEarlieriOS.html
If you have any problem then let me know.
This happens because of the resolution of iOS6 is lesser than iOs 7 simulator. You can use Autolayout option to solve this issue.

Resources