screen-orientation

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

删除回忆录丶 提交于 2019-11-30 17:12:12
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 in iOS 8 but not in iOS 9 ... Thanks In your current view controller, if you override

Android Action Bar Tab with scrollview made duplicate view after orientation change

荒凉一梦 提交于 2019-11-30 16:49:51
问题 I have a very simple code where I use Action Bar with tab fragments. It works fine after load, but after orientation change it goes crazy. The old fragment also visible (why?). Sorry for Hungarian texts on the image, but I hope it doesn't matter. I attach the code, maybe it helps to solve this problem. Main activity: public class Main extends Activity { private static ActionBar actionBar; @Override protected void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState);

Delphi Android - detect device orientation change

杀马特。学长 韩版系。学妹 提交于 2019-11-30 15:41:46
New to both Delphi Android development. How do I detect that the screen orientation has changed? i.e. from Portrait to Landscape and vice versa? And how do I fire off code when this happens? For example I have an image sized at let's say 300x200 in portrait mode but when the device switches to landscape I want it to adjust and take up full screen width. In your form implement a method procedure DoOrientationChanged(const Sender: TObject; const M: TMessage); where you handle the current orientation. Subscribe for orientation changes in FormCreate like this TMessageManager.DefaultManager

how do you make an app ONLY support landscape?

╄→гoц情女王★ 提交于 2019-11-30 13:49:43
问题 how do you make an app ONLY support landscape? No portrait mode JUST landscape throughout the whole thing in xcode 3? 回答1: My naive answer is to add this method in all of your root view controllers: - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { if (interfaceOrientation==UIInterfaceOrientationLandscapeLeft || interfaceOrientation==UIInterfaceOrientationLandscapeRight) return YES; return NO; } This is what I do in my game. Of course, my game only

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

寵の児 提交于 2019-11-30 11:53:48
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 : After orientation change buttons on a widget are not responding What's is the problem and how can be resolved ? Thanks. I eventually managed to recreate the OP's service

Display image from URL - sizing and screen orientation problems

独自空忆成欢 提交于 2019-11-30 09:45: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_width="fill_parent" android:layout_height="wrap_content" android:scaleType="fitCenter" android

how do you make an app ONLY support landscape?

这一生的挚爱 提交于 2019-11-30 08:49:25
how do you make an app ONLY support landscape? No portrait mode JUST landscape throughout the whole thing in xcode 3? My naive answer is to add this method in all of your root view controllers: - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { if (interfaceOrientation==UIInterfaceOrientationLandscapeLeft || interfaceOrientation==UIInterfaceOrientationLandscapeRight) return YES; return NO; } This is what I do in my game. Of course, my game only has one view controller. Also, I found it helpful to set "Initial interface orientation" in my app's info

Activity screen not rotating when I rotate mobile

安稳与你 提交于 2019-11-30 08:21:34
问题 I have used this code as @gnobal posted on https://stackoverflow.com/a/2700683/1556329 and it works great. But my issue is that I have found that when I apply Theme.Transparent the activity does not goes to landscape mode when I rotate the mobile phone. Theme: <style name="Theme.Transparent" parent="android:Theme.Dialog"> <item name="android:windowIsTranslucent">true</item> <item name="android:windowBackground">@android:color/transparent</item> <item name="android:windowContentOverlay">@null<

How can I use SensorManager.getOrientation for tilt controls like “My Paper Plane”?

爷,独闯天下 提交于 2019-11-30 06:26:01
问题 The Android game My Paper Plane is a great example of how to implement tilt controls, but I've been struggling to understand how I can do something similar. I have the following example that uses getOrientation() from the SensorManager. The whole thing is on pastebin here. It just prints the orientation values to text fields. Here is the most relevant snippet: private void computeOrientation() { if (SensorManager.getRotationMatrix(m_rotationMatrix, null, m_lastMagFields, m_lastAccels)) {

Android: Efficient Screen Rotation Handling

99封情书 提交于 2019-11-30 04:21:01
问题 In Android, when the screen orientation changes (between landscape and portrait) the onCreate method is called which ,if not handled properly, will recreate the entire activity when the result is too simply change the layout and retain all of the same information. I know of a few ways to solve this, but I'm interested in the most efficient way. 1) Telling the manifest that I will handle the orientation change by overriding the onConfigurationChanged() method and leaving it empty. 2) override