screen-orientation

Get phone orientation but fix screen orientation to portrait

帅比萌擦擦* 提交于 2019-11-27 12:41:57
I want to get the phone orientation but keep the screen orientation to portrait. So no matter the user turns the phone to landscape or portrait, the view stays the same, but I can get whether it is turned to landscape or portrait. Setting the activity to android:screenOrientation="portrait" will fix both but I wouldn't be able to detect the phone orientation via public void onConfigurationChanged(Configuration newConfig) { switch (newConfig.orientation) { case Configuration.ORIENTATION_PORTRAIT: Toast.makeText(this, "Portrait", Toast.LENGTH_SHORT).show(); break; case Configuration.ORIENTATION

iPhone Storyboard: different scene for portrait and landscape

浪尽此生 提交于 2019-11-27 11:49:00
If you scroll down a bit at this Apple Developer Page you'll find the section "Creating an Alternate Landscape Interface". The basic approach described there is to present a different NIB file as a modal view when orientation changes. I am using the Storyboard feature, so I don't have NIBs. How do I load a different "scene" in that case? Besides that, I am using a Tab Bar controller, I don't want to show a modal view. I just want to replace the current portrait view with a landscape view designed with interface builder and keep my tab bar. What would be the Storyboard way to achieve the task

How do I use a service to monitor Orientation change in Android

对着背影说爱祢 提交于 2019-11-27 11:17:45
问题 I'm writing a Widget that will display a countdown timer. I have the widget working the way I want it until I flip the phone from landscape to portrait. My widget does not update and goes to it's initial state at start of the widget until an onupdate is called by my recurring alarm. I would like to call an onupdate manually once the orientation changes to update my widget I've been researching this for a while now and I've found out that I need to use a Service which will monitor the

Android SensorManager strange how to remapCoordinateSystem

谁都会走 提交于 2019-11-27 09:33:19
问题 API Demos -> Graphics -> Compass It works properly only, until you don't change the device natural orientation. In most phones is the portrait and most 10 inch tablets are the landscape. If you change than need to rotate this with 90 degree. I would like to see a 3D fix for that system. 100% sure need to use remapCoordinateSystem() method. I would like to see how ( code ) if I could see an explanation with how is calculated those axes mapping ( theoretical math ) it would be nice. I have

iphone/ipad orientation handling

坚强是说给别人听的谎言 提交于 2019-11-27 06:23:31
This is more of a general question for people to provide me guidance on, basically Im learning iPad/iPhone development and have finally come across the multi-orientation support question. I have looked up a fair amount of doco, and my book "Beginning iPhone 3 Development" has a nice chapter on it. But my question is this, if I was to programatically change my controls (or even use different views for each orientation) how on earth to people maintain their code base? I can just imagine so many issues with spaghetti code/thousands of "if" checks all over the place, that it would drive me nuts to

How to handle screen orientation changes when there is an asyntask running with android 4.x

不羁的心 提交于 2019-11-27 06:07:01
问题 I tried to implement the following code to handle screen orientation changes. ****DataBaseUpdateService.java**** public class DataBaseUpdateService extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Updatetask Task = new Updatetask(this.getApplicationContext()); if(Task.getStatus() == AsyncTask.Status.PENDING){ Task.execute();}; } @Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged

Webview resizes automatically to portrait and landscape view in iphone

南笙酒味 提交于 2019-11-27 05:52:45
问题 I am new to iphone development.In my app, i want to display the web view in device with c portrait Orientation.It should also support landscape orientation. I used the below method but there is no expected output. - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight

I want my android application to be only run in portrait mode?

血红的双手。 提交于 2019-11-27 05:51:47
I want my android application to be only run in portrait mode? How can I do that? In the manifest, set this for all your activities: <activity android:name=".YourActivity" android:configChanges="orientation" android:screenOrientation="portrait"/> Let me explain: With android:configChanges="orientation" you tell Android that you will be responsible of the changes of orientation. android:screenOrientation="portrait" you set the default orientation mode. In Android Manifest File, put attribute for your <activity> that android:screenOrientation="portrait" Android Code Solution There are two ways,

i want to make my application only in landscape in android

感情迁移 提交于 2019-11-27 05:24:05
问题 I want to make my app work only in landscape mode but can't make it work. I have given screenOrientation = "landscape" even though the first page will be in landscape mode and other activity will be in portrait. XML FILE <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".Main" android:label="@string/app_name" android:screenOrientation="landscape" android:theme="@android:style/Theme.NoTitleBar.Fullscreen"> <intent-filter> <action android:name=

Why doesn't my Cordova/PhoneGap iOS app rotate when the device rotates?

落爺英雄遲暮 提交于 2019-11-27 04:40:07
I am trying to make a landscape only app , but I am not able to produce any rotation at all. There used to be a autorotate setting in PhoneGap.plist but in phonegap 1.8.0 I can find it. Does it still exists? What else could be wrong that my application is not rotating? UPDATE I know have webpage containing only one word "test". I set target device to iPad only and enabled all four orientations. What could still be wrong? Do need to have a special html document type? Do I need to include some cordova-1.8.0.js? I could not find one for iOS (!?!) so i tested it with the android version. I read