device-orientation

Prevent AlertView from auto rotating

南楼画角 提交于 2019-12-31 02:14:09
问题 The launch page of my app is set to portrait only with this little bit of code: - (NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskPortrait ; } When the app launches a UIAlertView appears for username and password entry. The method to display it is called from viewWillAppear . This worked fine for iOS6 but since iOS7 , if I switch the device to landscape, the main view remains in portrait but the the alert view and keyboard rotate to landscape. A further bizarre

Media queries and device orientation change

為{幸葍}努か 提交于 2019-12-30 10:52:44
问题 I've got the code below. What I would like to achieve is to switch between styles of a mobile device changes orientation from portrait to landscape (devices that have a large resolution like iPhone 4 or Galaxy S) <!doctype html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" /> <title>KUBIK</title> <style> #mobile, #tablet { display: none; } @media screen and (max-width: 767px) { body { background-color: #FF0000;

html5 - Get device orientation rotation in relative coordinate

只愿长相守 提交于 2019-12-30 09:36:25
问题 I'm trying to get the change in orientation between two deviceorientation events along the left-right axis, and top-bottom axis, those axis being usually defined as the phone x and y axis (https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Orientation_and_motion_data_explained) ie between instants t1 and t2 where those phone axis move from (x1, y1) to (x2, y2) , It'd like to get (angle(x2-x1), angle(y1-y2)) . When the device is in portrait mode (in opposition to landscape mode), those

Storyboards orientation support for xCode 4.2?

会有一股神秘感。 提交于 2019-12-29 04:41:12
问题 I upgraded to xCode 4.2 and it's new Storyboards feature. However, could not find a way to support both portrait and landscape. Of course, I did it programmatically, with 2 views, one for portrait and one for landscape, like in old days, and: if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight) { self.view = self.landscapeView; } else { self.view = self.portraitView; } But I was looking for a way to do this

JQuery distinct between smartphones, tablet or computers with different sizes but the same $(window).width()

浪子不回头ぞ 提交于 2019-12-26 15:07:47
问题 I got a problem I would like to solve trying to differentiate between different devices. The point is I have 3 different devices to test my code: - Moto G (3rd gen) (Smartphone): - Width screen: 6'3 cm - Height screen: 11 cm - Resolution: 720 x 1280 - Huawei T1-701w (Small tablet): - Width screen: 9 cm and - Height screen: 15'3 cm - Resolution: 600 x 1200 - Samsung sm-t580 (Big Tablet): - Width screen: 13'8 cm - Height screen : 21'9 cm - Resolution: 800 x 1280 I measured with my hands the cm

JQuery distinct between smartphones, tablet or computers with different sizes but the same $(window).width()

谁都会走 提交于 2019-12-26 15:06:06
问题 I got a problem I would like to solve trying to differentiate between different devices. The point is I have 3 different devices to test my code: - Moto G (3rd gen) (Smartphone): - Width screen: 6'3 cm - Height screen: 11 cm - Resolution: 720 x 1280 - Huawei T1-701w (Small tablet): - Width screen: 9 cm and - Height screen: 15'3 cm - Resolution: 600 x 1200 - Samsung sm-t580 (Big Tablet): - Width screen: 13'8 cm - Height screen : 21'9 cm - Resolution: 800 x 1280 I measured with my hands the cm

Force iPad app to launch in portrait when landscape is supported

半城伤御伤魂 提交于 2019-12-24 01:17:41
问题 My iPad app contains a single view somewhere in the app that supports landscape mode. For the shouldAutorotateToInterfaceOrientation in that view to be called I had to declare in the info.plist that landscape is supported. Problem: The UITabController which is shown when the app is launched doesn't support landscape mode and I made sure to specify it in all the tabbar's view controller. Yet, when the app is launched while the device is in landscape mode, the tabcontroller is shown in

Android Orientation Change Crashes Application

与世无争的帅哥 提交于 2019-12-24 00:54:49
问题 I have an activity with simple layout file that will hold a fragment created and added to it programmatically. The fragment does not have any layout file since I create layout programmatically as shown below: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:id="@+id/bubble

UITableView portion loses interaction after device rotation

旧时模样 提交于 2019-12-23 16:16:34
问题 I have a UIViewController with a UIView subclass as a subview, and in here is a UITableView added as a subview of that UIView, as follows: UIViewController -UIView --UITableView (plucked from a UITableViewController) On an iPad, if I load the view controller in either orientation I can interact with the table view perfectly. However, if I rotate the device to a new orientation - I have code that alters the frames to make it fit the new resolution, but a small area of the table does not

Problem with camera when orientation changes

北城以北 提交于 2019-12-23 14:58:09
问题 I'm doing an application that calls a different activity when the device orientation changes from landscape to portrait or viceversa. The activity for the landscape mode is an augmented reality one, so I use the camera to show the surroundings to the user. However, when I try to go back to portrait, the app crashes and displays this error: 08-17 16:05:42.622: ERROR/AndroidRuntime(9769): FATAL EXCEPTION: main 08-17 16:05:42.622: ERROR/AndroidRuntime(9769): java.lang.RuntimeException: set