How can I test landscape view using the iPhone Simulator? - cocoa-touch

I wonder if I can test landscape view using simulator?

Under the Hardware Menu you will find the rotation items which correspond to CMD+Left and CMD+Right

In the Hardware menu, there is an option to change the orientation. Also, Cmd-Left and Cmd-Right will rotate the virtual phone.

Setting simulator orientation in IDE
The above (hardware->device) is a solution for rotating the simulator only once the simulator is launched ,but there should be also an option in your IDE to define the orientation of the simulator.
If you are using JDeveloper IDE the go to
Application --> Deploy --> New Deployment Profile --> select Profile Type(iOS) --> iOS Options --> Device Orientations.
IDE Device orientations.
There you can mention which orientation you need by default, either landscape or portrait.
Short cut key for switching Orientations
Press command key and press left arrow / right arrow.
This would switch between the landscape and portrait views you require.
I hope this might help your query.

[enter image description here][1]
I was struggling with this exact problem for about an hour.
On the left-most project navigator screen, click the name of your project (should be the highest dropdown button), then click the general tab on the page that opens up, scroll down and you should see a section titled "Deployment Info" Make sure you select the checkbox of each orientation you want available for your project.
Test your simulation again.
[1]: https://i.stack.imgur.com/4nW9D.png

Related

When the simulator is in landscape mode, the inspector isn't reverted as it had to

I want to use Appium inspector in order to generate my scripts.
When my app is in portrait mode the appium inspector is working fine.
But when i want to use in lLandscape mode check the schema i have provided :
In landscape we have 2 possibilities in our application. In My case the application rotate and the screen is in the same position as i provide in the schema (Landscape 2).
At that moment the appium recorder is seeing it as if it was in (Landscape 1).
Is there a way to fix the red rectangle as i have mentionned in (Landscape 2).

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 6 Simulator

I downloaded the xcode for iOS6 along with the simulator. Now, when I run my cocos2d project, the screen doesnt follow along with the device turns. It always stays in the "up" position, when it used to always stay in the "right" position. Does anyone know how to fix this?
iOS 6 introduces a new mechanism for nominating supported interface orientations; see 'Handling View Rotations' in the UIViewController documentation.
The short version is that unless you implement -supportedInterfaceOrientations on your view controller to further limit the options then whatever orientations you specified as supported in your Info.plist will be used.
So quite probably you want to click on your project in the top left hand corner of the Xcode project navigator, select your target in the left-hand bar of the content on the right, then 'Summary' in there and ensure you have only the landscape right orientation selected.
E.g.

Force showing keyboard in metro?

I'd like to be able to force the keyboard to show on screen in my Metro app. My goal is to test out different layouts/controls and get a feel for the interaction. My problem is that I'm running Win8 on a MacBook Pro (Parallels) and I don't know how to override the physical keyboard and show it on screen instead.
Similarly, I'd like to be able to force rotation if possible.
You could run your app the Simulator. You can put the Simulator in "Touch Mode" and that will interpret mouse clicks as touch events in the on screen controls like Text Boxes and you can choose to rotate the Simulator into profile as well.

how to change mainwindow.xib's orientation to landscape? [duplicate]

I appreciate I'm probably missing something basic here, but...
My iPad app will only support landscape mode, and has a MainWindow.xib Window that I'd like to work on in landscape mode in XCode 4, however the pull-down menu to change this (Simulated Metrics -> Orientation) is always grayed out.
I notice that Views can be rotated just fine, it's only Windows that can't be rotated in XCode 4 using this setting.
Is there a workaround for this, or do I have to put a View on top of the MainWindow in order to rotate it?
I think it's because apps always starts up in portrait and then rotates to appropriate oriantations. From the UIViewController docs:
Note: At launch time, applications should always set up their
interface in a portrait orientation. After the
application:didFinishLaunchingWithOptions: method returns, the
application uses the view controller rotation mechanism described
above to rotate the views to the appropriate orientation prior to
showing the window.
So you'll need the UIViewController magic for the simulated metrics to make any sense. If you used the "Window-based application" template as a starting point for your project try the "View-based application" template instead.