landscape-portrait

Android - switching between landscape and portrait mode makes Intent lose values

余生颓废 提交于 2019-11-27 19:25:13
I am using Intents to switch between activities in my Android app. I am putting data in the Intent for use in the next activity. When I switch the phone between landscape and portrait modes, the values passed from the intent are lost and I get a NullPointerException. Can someone please tell me what could be wrong. There's a lot of code to post it entirely. But if someone needs to look at specific parts of code, I can post it here. Edit I solved the issue of state not being saved. But another problem I faced is that none of the buttons on the screen work after the orientation has been changed.

Autorotate a single UIViewController in iOS 6 with UITabBar

时光怂恿深爱的人放手 提交于 2019-11-27 17:37:36
I have an app that work only in Portrait Mode , but there is a singleView that can display video, so i want that view work also in the landscape mode , but in iOS 6 I can't figure out how I can do it, now I have this: In AppDelegate.m i have: self.window.rootViewController = myTabBar; then in the Summary of the project: and i found that in iOS 6 to detect the view rotation i have to do this: - (NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskAll; } // Tell the system It should autorotate - (BOOL) shouldAutorotate { return YES; } so i insert the code above only in

Creating different layout for android phone and tablet

落爺英雄遲暮 提交于 2019-11-27 04:47:23
This is a basic android question. I have app which need to have different screen design for a phone and a tablet. The phone needs to have a ListView and the Tablet need to have a GridView of items. I wish to know how can I do this without making two different apps. Thanks Basically you have to make different layouts for both android phone and tablets. Android is smart enough to differentiate. For example for large screen you can just make a new folder namer Layout-large. and put your tablet xml in it. Android will pick xml from here and in case of phone it will pick from simple layout folder.

What is the “right” way to handle orientation changes in iOS 8?

隐身守侯 提交于 2019-11-27 02:36:44
Can someone please tell me the "right" or "best" approach to working with portrait and landscape interface orientations in iOS 8? It seems that all the functions I want to use for that purpose are deprecated in iOS 8, and my research has turned up no clear, elegant alternative. Am I really supposed to look at the width and height to determine for myself if we are in portrait or landscape mode? For example, in my view controller, how should I implement the following pseudocode? if we are rotating from portrait to landscape then do portrait things else if we are rotating from landscape to

Android - switching between landscape and portrait mode makes Intent lose values

霸气de小男生 提交于 2019-11-26 19:52:17
问题 I am using Intents to switch between activities in my Android app. I am putting data in the Intent for use in the next activity. When I switch the phone between landscape and portrait modes, the values passed from the intent are lost and I get a NullPointerException. Can someone please tell me what could be wrong. There's a lot of code to post it entirely. But if someone needs to look at specific parts of code, I can post it here. Edit I solved the issue of state not being saved. But another

Autorotate a single UIViewController in iOS 6 with UITabBar

喜你入骨 提交于 2019-11-26 19:10:00
问题 I have an app that work only in Portrait Mode , but there is a singleView that can display video, so i want that view work also in the landscape mode , but in iOS 6 I can't figure out how I can do it, now I have this: In AppDelegate.m i have: self.window.rootViewController = myTabBar; then in the Summary of the project: and i found that in iOS 6 to detect the view rotation i have to do this: - (NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskAll; } // Tell the

Creating different layout for android phone and tablet

左心房为你撑大大i 提交于 2019-11-26 11:21:24
问题 This is a basic android question. I have app which need to have different screen design for a phone and a tablet. The phone needs to have a ListView and the Tablet need to have a GridView of items. I wish to know how can I do this without making two different apps. Thanks 回答1: Basically you have to make different layouts for both android phone and tablets. Android is smart enough to differentiate. For example for large screen you can just make a new folder namer Layout-large. and put your

What is the “right” way to handle orientation changes in iOS 8?

廉价感情. 提交于 2019-11-26 10:07:10
问题 Can someone please tell me the \"right\" or \"best\" approach to working with portrait and landscape interface orientations in iOS 8? It seems that all the functions I want to use for that purpose are deprecated in iOS 8, and my research has turned up no clear, elegant alternative. Am I really supposed to look at the width and height to determine for myself if we are in portrait or landscape mode? For example, in my view controller, how should I implement the following pseudocode? if we are

Zxing Camera in Portrait mode on Android

只谈情不闲聊 提交于 2019-11-26 07:23:43
I want to show portrait orientation on Zxing 's camera. How can this be done? Here's how it works. Step 1: Add following lines to rotate data before buildLuminanceSource(..) in decode(byte[] data, int width, int height) DecodeHandler.java: byte[] rotatedData = new byte[data.length]; for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++) rotatedData[x * height + height - y - 1] = data[x + y * width]; } int tmp = width; width = height; height = tmp; PlanarYUVLuminanceSource source = activity.getCameraManager().buildLuminanceSource(rotatedData, width, height); Step 2: Modify

Zxing Camera in Portrait mode on Android

风格不统一 提交于 2019-11-26 01:58:10
问题 I want to show portrait orientation on Zxing \'s camera. How can this be done? 回答1: Here's how it works. Step 1: Add following lines to rotate data before buildLuminanceSource(..) in decode(byte[] data, int width, int height) DecodeHandler.java: byte[] rotatedData = new byte[data.length]; for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++) rotatedData[x * height + height - y - 1] = data[x + y * width]; } int tmp = width; width = height; height = tmp; PlanarYUVLuminanceSource