portrait

How do I lock screen orientation for phone, but not for tablet? (Android)

北战南征 提交于 2019-12-18 19:06:20
问题 I have been working on a Android project, that is intended to be compatible with both the Android phones and tablets. On the tablet the app is working great and looks good too. However, on the phone we have been running into issues both programmatically and layout wise (working with a 10.1 inch screen is a lot easier than a 4 inch screen). To solve some of these problems we have decided to deactivate screen orientation but only for the phone version, atleast temporarily. The question is

How to find out if ipad is in landscape/portrait mode in javascript/jquery?

蹲街弑〆低调 提交于 2019-12-18 13:32:49
问题 I want to add an extra div if the ipad is in landscape mode. Is there some sort of if statement that could find this out? Thanks 回答1: jQTouch checks it like so: orientation = Math.abs(window.orientation) == 90 ? 'landscape' : 'portrait'; http://github.com/senchalabs/jQTouch/blob/master/jqtouch/jqtouch.js You can also listen to onorientationchange events See previous answer: Detect rotation of Android phone in the browser with JavaScript 回答2: You could do a simple check for the width of the

How to convert & rotate raw NV21 array image (android.media.Image) from front cam portrait mode in onImageAvailable (android Camera2)?

左心房为你撑大大i 提交于 2019-12-18 03:46:48
问题 Note: All info in my post only goes for Samsung Galaxy S7 device. I do not know how emulators and other devices behave. In onImageAvailable I convert continuously each image to a NV21 byte array and forward it to an API expecting raw NV21 format. This is how I initialize the image reader and receive the images: private void openCamera() { ... mImageReader = ImageReader.newInstance(WIDTH, HEIGHT, ImageFormat.YUV_420_888, 1); // only 1 for best performance mImageReader

Android - Camera preview is sideways

人走茶凉 提交于 2019-12-16 20:41:42
问题 I am using a Preview to display what the camera see's on the screen. I can get everything working fine, surface created, surface set and the surface is displayed. However it always displays the picture at an incorrect 90 degree angle in portrait mode. Such as in the picture: I am aware that using the following code will set the picture straight: setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); However I have the Preview within an Activity that has other elements in it and

Android AndroidManifest 清单文件以及权限详解

核能气质少年 提交于 2019-12-15 20:45:59
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 每个Android应用都需要一个名为AndroidManifest.xml的程序清单文件,这个清单文件名是固定的并且放在每个Android应用的根目录下。它定义了该应用对于Android系统来说一些非常重要的信息。Android系统需要这些信息才能正常运行该应用。Android程序清单文件主要具有下面作用: · 它给应用程序Java包命名,这个包名作为应用程序唯一标识符。 · 它描述了应用程序中的每个程序组件—Activity,Service,Broadcast Receivers和Content Provider。它描述了实现每个应用程序组件的类名称和组件能力(比如组件能够处理哪种类型的Intent消息)。这些描述帮助Andoid操作系统了解这些程序组件和在何种条件下可以启动这些程序组件。 · 它决定哪些进程用来运行应用程序组件。 · 它描述了应用程序使用某些受保护的程序API或和其它应用程序交互所需的权限。 · 它也描述了其它应用程序和该应用交互时应拥有的权限。 · 它列出了Instrumentation类用于提供应用程序运行时一些性能统计和其它信息。这些生命只在测试或开发应用时使用。在发布应用时应该删除。 · 它给出了应用运行所需AndroidAPI版本的最低要求。 ·

screen orientation

大城市里の小女人 提交于 2019-12-12 23:41:08
问题 Hi M new to android.I faced a problem i.e in landscape mode i need a layout view which doesnot have some feilds which are present in the portrait mode.I have created a layout for landscape view in such a way.In the activity i have given the conditions like if portrait display some feilds some hide.its working properly actually...first when i go from portrait to landscape it is giving what i want...but when i go to portrait mode its stopping the application.please help me.Thanks in advance 回答1

presentModalViewController in landscape after portrait viewController

非 Y 不嫁゛ 提交于 2019-12-12 12:33:47
问题 I have a main viewController that is in portrait mode all the time. I want then to presentModalViewController, but it will come from the left (not from bottom of the screen) in landscape. Is it possible? tnx 回答1: In your modal view controller implementation, override -shouldAutorotateToInterfaceOrientation: - (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationPortrait); } 回答2: I came across this

Best practice to support portrait and landscape views in a UINavigationController

余生颓废 提交于 2019-12-12 11:01:12
问题 I searched high and low and I'm not sure what I came out with is the best way of dealing with this (though it seems the only one). According to Want to use muliple nibs for different iphone interface orientations I implemented the relevant methods, and everything seems to work fine. Unfortunately I have to deal with a UINavigationController, and each page has to support both portrait and landscape modes, and reproduce the same functionalities in both modes. That means that If a user at some

How to enable only portrait and reverse portrait in phones, “sensorPortrait” not working on phones?

∥☆過路亽.° 提交于 2019-12-12 09:37:49
问题 I cant figure out why setting "sensorPortrait" attribute in manifest for an activity doesn't work to allow the activity to go into reverse portrait. This is how I set in manifest <activity android:name=".MainActivty" android:label="Testing" android:screenOrientation="sensorPortrait" android:windowSoftInputMode="stateHidden" android:configChanges="orientation"> </activity> The above code is not working for me to get both reversePortrait and portrait on Moto E(4.4.4) or Galaxy S3(4.3), but I

Universal app and landscape orientation for iPad

爱⌒轻易说出口 提交于 2019-12-12 01:06:37
问题 I want to design a universal app that I'd want to support just portrait orientation. It's weird because Xcode allows you to select portrait orientation only in the target's Deployment Info settings (and in Info.plist), but reading the iOS Human Interface Guidelines, in the section regarding the launch images, I've found this: You must provide at least one launch image. Typically, an iPhone app includes at least one launch image in portrait orientation; an iPad app includes at least one launch