portrait

iOS CAlayer Orientation AVCaptureVideoPreviewLayer doesn't rotate

匿名 (未验证) 提交于 2019-12-03 00:59:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Summary: I can't force the CALayer to respond correctly to orientation changes. Whenever I try to use cgaffinetransform I am getting weird results (layer is not centered). Any help will be appreciated! thanks, Process I am adding a preview of video using AVCaptureVideoPreviewLayer subclass. When device is in a portrait orientation everything looks fine. The problem appears when device is rotated to landscape orientation (left or right) or portrait upside down. I am adding a preview of video using AVCaptureVideoPreviewLayer subclass. When

android调用setRequestedOrientation之后

ⅰ亾dé卋堺 提交于 2019-12-02 21:59:41
最近在做播放器的时候遇到一个问题,在屏幕方向改变之后需要切换播放器全屏/非全屏的时候,在重写了onConfigurationChanged方法并在manifest.xml配置文件中添加 android:screenOrientation="sensor" android:configChanges="orientation|screenSize|smallestScreenSize|keyboard|keyboardHidden|navigation" 之后,在屏幕方向改变之后确实切换了播放器的方向,但是在我的程序中,需要一个播放器控制按钮,当用户点击按钮时手动切换播放器方向(即播放器全屏/小屏状态切换)和屏幕方向改变时自动切换两个功能并存;最开始想的是直接使用setRequestedOrientation()设置屏幕方向应该就OK了,但是发现这样做是行不通的.之后了解到因为setRequestedOrientation设置屏幕方向之后,比如说setRequestedOrientation(portrait)方法,就设定了屏幕方向是portrait,和在清单文件中配置android:screenOrientation="portrait"是同等的效果;也即不再响应屏幕方向改变,只支持portrait方向;   言归正转,说我的处理方法

Force orientation to Portrait Mode

北城以北 提交于 2019-12-02 13:12:13
问题 I have all the app in portrait mode, but I have one of the viewcontroller in landscape mode to be a gallery of images. On the tab Project Summary enable LandscapeLeft mode, so I have to disable the rotation this way in the rest of the Viewcontroller, except in the VC of the image gallery. I want to keep the rotation in Portrait mode, to do this and to block all the VC portrait, I used the following code -(BOOL)shouldAutorotate{ return YES; } -(NSInteger)supportedInterfaceOrientations{ return

Set the orientation to portrait from code

感情迁移 提交于 2019-12-02 02:17:41
I know I can limit the orientation from the manifest file. Like this android:screenOrientation="portrait" But is it possible to set the orientation from code ? for example setting the activity to full screen can be done both from manifest and from code this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); Shailendra Singh Rajawat Activity. setRequestedOrientation(..) 来源: https://stackoverflow.com/questions/8035453/set-the-orientation-to-portrait-from-code

Cannot rotate interface orientation to portrait upside down

醉酒当歌 提交于 2019-12-01 18:07:15
问题 Both on iPhone simulator and iPhone 3GS (iOS 6) I cannot manage to set the orientation to portrait upside down. I have just one ViewController. I've added this code in it: -(BOOL) shouldAutorotate{ return YES; } -(UIInterfaceOrientation) preferredInterfaceOrientationForPresentation{ return UIInterfaceOrientationPortraitUpsideDown; } - (NSUInteger)supportedInterfaceOrientations{ return UIInterfaceOrientationPortrait | UIInterfaceOrientationPortraitUpsideDown; } -(BOOL)

Cannot rotate interface orientation to portrait upside down

随声附和 提交于 2019-12-01 17:43:20
Both on iPhone simulator and iPhone 3GS (iOS 6) I cannot manage to set the orientation to portrait upside down. I have just one ViewController. I've added this code in it: -(BOOL) shouldAutorotate{ return YES; } -(UIInterfaceOrientation) preferredInterfaceOrientationForPresentation{ return UIInterfaceOrientationPortraitUpsideDown; } - (NSUInteger)supportedInterfaceOrientations{ return UIInterfaceOrientationPortrait | UIInterfaceOrientationPortraitUpsideDown; } -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation{ if (toInterfaceOrientation=

Disable landscape-mode for mobile devices

自闭症网瘾萝莉.ら 提交于 2019-12-01 14:49:48
Hi there i created a responsive mobile website using this: max-width(480px) {etc..} + <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> For every mobile device the website looks the same => great. But when i change to landscape there is more than 480px and the website-variation of the desktop displays. Is there any possibility to disable the auto-rotate or to show the portrait-mode on mobile-device even if there is more than 480px? Greetings You can try and target specific orientation with your media query: @media max-width(600px) and

Disable landscape-mode for mobile devices

こ雲淡風輕ζ 提交于 2019-12-01 13:32:28
问题 Hi there i created a responsive mobile website using this: max-width(480px) {etc..} + <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> For every mobile device the website looks the same => great. But when i change to landscape there is more than 480px and the website-variation of the desktop displays. Is there any possibility to disable the auto-rotate or to show the portrait-mode on mobile-device even if there is more than 480px?

AS3/AIR: If phone use portrait, if tablet use landscape?

末鹿安然 提交于 2019-12-01 09:56:01
问题 Ok, I've written myself a simple DeviceCapabilites class to be able to check if the device is a phone or tablet etc. But I need to be able to say that if the user is on a phone, it should be in portrait mode, and if on tablet I only wanna use landscape mode... Any ideas? EDIT: To make it clear, I want to lock the orientation to portrait mode on phones and then use landscape on tablets. 回答1: Something like this? stage.autoOrients = false; if(YourDeviceCapsClass.isTablet) stage.setOrientation

JQuery mobile - content navigation collapse on a button on portrait

大城市里の小女人 提交于 2019-12-01 08:42:03
问题 We are developing an application with the layout near to the jqm examples here( table of contents on left and contents at right) but we want the same behavior as Sencha mobile, when it's in portrait, the table of contents collapses in a navigation button here Is it possible to do with jqm? 回答1: I have created a sample jQuery Mobile application which works like this - When in portrait mode,a split view layout will be shown.When in landscape mode,navigation can be done via a button in the