screen-orientation

App size is too big because of too many images

谁说胖子不能爱 提交于 2019-12-05 01:30:57
问题 I'm creating an universal app. For one screen, I'm displaying 6 images (png format) in a grid using this control. Also this screen supports both portrait and landscape orientation. I've created a set of images in different resolutions for all the iDevices and named them using the correct naming convention as follows. name~iphone.png name@2x~iphone.png name~ipad.png name@2x~ipad.png name-568h@2x~iphone.png (iPhone 5) And I had to create another set of these images since I support both

Programmatically enabling/disabling screen rotations in Android

家住魔仙堡 提交于 2019-12-04 18:40:13
问题 I have an app which displays a large amount of text for the user to read. I've found that when reading while lying down, I get annoyed that the screen rotates even though my head and the screen are aligned. I do not want to set this to be permanently in portrait mode, so I think this would preclude an approach of setting the android:screenOrientation="portrait" in the manifest. Ideally, I would like to enable/disable automatic orientation changes via a preference page. What would be my best

Determining the Orientation of the screen rather than the orientation of the device

醉酒当歌 提交于 2019-12-04 16:41:49
问题 The [[UIDevice currentDevice] orientation] method returns a number of orientations beyond the portrait and landscape orientation. I am well aware of checking to see if the orientation returned is "valid", unfortunately if the orientation returned is NOT "valid" when my app requires a specific orientation to determine which methods to run, I have no way of knowing which method is appropriate. I have attempted a number of solutions to this, but for now the only thing I have been able to work

Android splash screen for both landscape and portrait orientation

ぐ巨炮叔叔 提交于 2019-12-04 16:37:01
How can I modify my this code to set splash screens for both landscape and portrait orientation. I managed to work on portrait mode and it is working fine. i like ti make it for both the orientation. please modify this code. This is my SplashActivity.java. public class SplashActivity extends Activity { // Splash screen timer private static int SPLASH_TIME_OUT = 3000; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.splash_screen); new Handler().postDelayed(new Runnable() { /* * Showing splash screen with a timer. This

How to set screen-orientation for other apps?

余生长醉 提交于 2019-12-04 16:03:47
With the following lines we can set the orientation with in the application.. setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); If I want to set the orientation to every screen(not only with in application). how can i do this? Any help. Thanks in advance setRequestedOrientation(0); or setRequestedOrientation(1); horizontal (landscape) - 0 vertical (potrait) - 1 You can try this. Or you can try it in your way. In the onCreate method of that activity, which orientation you like to change,put this code in that.

Gracefully handling screen orientation change during activity start

跟風遠走 提交于 2019-12-04 13:24:02
问题 I'm trying to find a way to properly handle setting up an activity where its orientation is determined from data in the intent that launched it. This is for a game where the user can choose levels, some of which are int portrait orientation and some are landscape orientation. The problem I'm facing is that setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) doesn't take effect until the activity is fully loaded. This is a problem for me because I do some loading and image

Cordova ignores screen orientation lock [duplicate]

六眼飞鱼酱① 提交于 2019-12-04 11:43:25
问题 This question already has answers here : fix the orientation on page to landscape only in Jquery-mobile (3 answers) Closed 4 years ago . I'm using Cordova 3.3.0 with my Galaxy S3 (running latest Cyanogenmod) to test an app I'm working on; I need the app screen to remain in "portrait" mode and be locked even if the user rotates the device. No matter what I tried or tutorials I followed, the app is ignoring the preferences to lock the screen. What am I doing wrong? Here's my config.xml: <?xml

How to set orientation in nativescript

核能气质少年 提交于 2019-12-04 10:22:58
问题 Hello I would like to know how to set device orientation in nativescript. Specifically I want the application that I am writing to stay in the same orientation (portrait) at all times so that rotating the device does not cause it to go into landscape. I tried the nativescript-orientation plugin and setOrientation. var orientation = require('nativescript-orientation'); console.log(JSON.stringify(orientation));// outputs JS: {} orientation.setOrientation("portrait"); However I get the error

sensorPortait typo

孤者浪人 提交于 2019-12-04 06:38:10
http://developer.android.com/reference/android/R.attr.html#screenOrientation is sensorPortait a typo mistake? I see threads around guiding people to use sensorPortrait but my eclipse works with sensorPortait instead. It doesn't matter - its consistent, also for reversePortait, and as you said, eclipse doesn't let you use sensorPortrait. But my guess is that someone in Google is copy-pasting too much... 来源: https://stackoverflow.com/questions/7964848/sensorportait-typo

Android Memory Leak, no static variables

谁都会走 提交于 2019-12-04 05:30:47
问题 I'm a beginning Android developer, and as a practice project, I'm trying to make and activity which can take a picture, save it to the external storage, and display it in an ImageView. Almost everything seems to be working, however, I appear to have a memory leak. When the screen orientation changes, I believe the activity is destroyed, then recreated. In order to continue displaying the image, I am storing the path to the image as a string in a bundle in onSaveInstanceState and resetting the