screen-orientation

Tablet Screen Orientation Change - No View found for id for Fragment

爷,独闯天下 提交于 2019-11-30 03:10:33
问题 I have looked at questions related to my problem on SO but couldn't figure out what the problem is. Bear with me if this is a repost. Here is what i am looking for: The layout changes for phone are working fine as it involves the same views inside the fragment. The problem is when i try get the below layout in tablets. activity_main.xml in portrait mode: <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/drawer_layout" android

Android - Lock orientation to two directions only

て烟熏妆下的殇ゞ 提交于 2019-11-30 02:53:32
问题 How can make my android application to be Landscape or portrait but without the reverse directions? Meaning that I want to enable SCREEN_ORIENTATION_PORTRAIT and SCREEN_ORIENTATION_LANDSCAPE but to disable SCREEN_ORIENTATION_REVERSE_LANDSCAPE and SCREEN_ORIENTATION_REVERSE_PORTRAIT . Thanks 回答1: I had the same problem/feature request in my camera app, and found this post: android camera surfaceview orientation In changeRotation just comment ORIENTATION_PORTRAIT_INVERTED and ORIENTATION

Replacing fragments and orientation change

﹥>﹥吖頭↗ 提交于 2019-11-30 01:52:19
I'm developing an Android application targeting 2.x and 3.0 devices and thus I'm using the compatibilty API. I'm testing on Android 2.0. I'm trying to replace a displayed fragment with another one (search form with search results) and I'm experiencing a crash on orientation change when the second (results) fragment is displayed. Basically, I have an activity, that includes a fragment defined in layout xml as <fragment class="org.prevoz.android.search.SearchFormFragment" android:id = "@+id/search_form_fragment" android:layout_width = "fill_parent" android:layout_height = "fill_parent" /> The

“viewWillTransitionToSize:” not called in iOS 9 when the view controller is presented modally

北战南征 提交于 2019-11-30 00:31:52
问题 I present a view controller from another one: - (void)showModalView { UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; MySecViewController *mySecViewController = [storyboard instantiateViewControllerWithIdentifier:@"secController"]; mySecViewController.delegate = self; [self presentViewController:mySecViewController animated:YES completion:nil]; } Then in the presented UIViewController , the method viewWillTransitionToSize:withTransitionCoordinator: is called

Detect iPad orientation change

╄→гoц情女王★ 提交于 2019-11-29 22:13:22
How to detect with javascript or jquery when user turns iPad from vertical position to horizontal or from horizontal to vertical? Try $(window).bind('orientationchange', function(event) { alert('new orientation:' + event.orientation); }); You can detect the orientation change event using the following code: jQuery: $(document).ready(function() { $(window).on('orientationchange', function(event) { console.log(orientation); }); }); Check if device is in portrait mode function isPortrait() { return window.innerHeight > window.innerWidth; } In Javascript: <button onclick="detectIPadOrientation();"

MPMoviePlayerController fullscreen quirk in iPad

流过昼夜 提交于 2019-11-29 21:55:55
I want to show a MPMoviePlayerController in a view controller and let the user toggle full screen with the default controls, like the YouTube app. I'm using the following code in a bare-bones example: - (void)viewDidLoad { [super viewDidLoad]; self.player = [[MPMoviePlayerController alloc] init]; self.player.contentURL = theURL; self.player.view.frame = self.viewForMovie.bounds; self.player.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; [self.viewForMovie addSubview:player.view]; [self.player play]; } This works well until the user makes the video

After orientation change buttons on a widget are not responding [duplicate]

左心房为你撑大大i 提交于 2019-11-29 18:13:05
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: After orientation change buttons on a widget are not responding I'm facing a problem with an appwidget that has one ImageView inside the xml layout for which I register a pendingintent that is handled in OnReceive method . Everything works okay until I change phone orientation. At this point the widget doesn't work anymore, I click on the image but nothings happens. This problem is exactly as the one here :

Android Orientation Change

假如想象 提交于 2019-11-29 15:34:02
问题 My tabbed app does not redisplay the view with an orientation change. I added android:configChanges="keyboardHidden|orientation" to the main tab activity and to each activity in the manifest. I added to each activity this method: public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); setContentView(R.layout.active_alt); mColorLegendBtn = (Button) findViewById(R.id.colorbtn); mStatusView = (TextView) findViewById(R.id.celltitle1); TextView

Display image from URL - sizing and screen orientation problems

守給你的承諾、 提交于 2019-11-29 14:43:33
问题 I am trying to display an image from a URL, which may be larger than the screen dimensions. I have it kind of working, but I would like it to scale to fit the screen, and I also have problems when the screen orientation changes. The image is tiny, and I would like it to scale its width to the screen as well. (In both cases, I would like the image to fill the screen width with scrollbars (if necessary for height). Here is my ImageView: <ImageView android:id="@+id/ImageView01" android:layout

How to get current orientation of device programmatically in iOS 6?

允我心安 提交于 2019-11-29 11:07:58
问题 I have developed an iOS App and tested it on iOS6 device. While testing, I realized that my App is not responding to Orientation changes as expected. Here is my Code: // Autorotation (iOS >= 6.0) - (BOOL) shouldAutorotate { return NO; } - (NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskAll; } - (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { return UIInterfaceOrientationMaskPortrait; } Precisely, I want to know that what Methods are called