I want to show ActionBar menu when Device orienation is changed - oncreateoptionsmenu

I am trying to show the ActionBar Menu in fragments, When device orientation is changed from portrait to landscape or vice versa Menu is dismissed. I want to show menu when device orientation is also changed.
I don't want to provide a android:configChanges="orientation|screenSize"in manifest file.

I guess you need a new layout-land, that will change when the device is rotated.
Check this video/class from Google, maybe will help you :
https://classroom.udacity.com/courses/ud851/lessons/92320789-2acc-42cc-9d64-b1d0e5f1947a/concepts/d0a07b3a-9654-47fd-8079-9970a888b9b9

Related

Is it possible to programmatically force an ios ap in split view to go full screen in ios9?

I am developing this app for ipad and ios9 and at some point the user will click on a button to watch a video. But I wouldn't want the user to just see it in the split view size he's currently on (like 1/3rd or 14th) instead I would like the app to close the other open app and for it to take over the entire screen.
Does anyone know if that's possible? Thanks.
By-default, the video always get played in full-screen mode. When video playing is finished, the player gets dismissed and you will see your screen (from where you played the video). In your case, in split view controller.
Do let me know if you need further details.

iPad: How to handle multiple popovers regarding human guidelines?

I haven't notice an issue in my iPad App, where two popovers are visible at once. Because of that, my App got rejected with this comment:
The iPad Human Interface Guidelines state that only one popover element should be visible onscreen at a time. In your application, the user can display two popovers at the same time. See the attached screenshot.
First of all, I would move the settings button to the right-side in the new version, but what if News popover is open and I tab the settings button -- what is expected behavior regarding their human guidelines? 1. Should I dismiss the News popover before I present the settings popover or 2. could I just do nothing, since the other popover is active?
I strongly guess that the first is right, but I would like to do it right this time. Thank you.
To quote Apple's Interface Guidelines:
Avoid providing a “dismiss popover” button. A popover should close automatically when its presence is no longer necessary.
If a user taps the "Settings" button, then assume the user would like the settings to be viewable and dismiss the first popover. Visa Versa for the other button.
Yes, you should simply dismiss the news popover before the settings are shown.

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.

Seems like it should be easy: Landscape Scrolling Text Field

I have a application that I am working on that is in landscape mode and does not rotate. However I can not get the text field to rotate. I have been putting in way to many hours so don't be to harsh if this is a easy answer...
Are you using Interface Builder to create the view? In that case, adding the UITextField to the UIView in landscape mode. In case you do not know how to use IB for creating views in landscape mode, open the UIView object in IB. There is a small arrow on the top-right corner of the view. Click on that arrow to rotate the view to landscape mode.
Edit your Info.plist file so that it includes the "Initial device orientation" key and specify UIDeviceOrientationLandscapeLeft (the Home button should be to the right if an app opens in landscape, according to Apple's UI guidelines). Some samples come with this property already in the plist, but most don't.

How can I test landscape view using the iPhone Simulator?

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