orientation

How to lock the camera app orientation called through intent in android?

浪子不回头ぞ 提交于 2019-12-12 09:03:32
问题 I want to open the native camera app through intent in my application. I have used the following lines of code. Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(f)); startActivityForResult(takePictureIntent, actionCode); Now, I want to lock the orientation of camera in portrait when it is opened . I just added the below line to the above piece of code. takePictureIntent.putExtra(MediaStore.EXTRA_SCREEN

How to force landscape mode in AVPlayer?

大城市里の小女人 提交于 2019-12-12 07:59:25
问题 I'm looking for a way to force a AVplayer (Video) to only display itself in landscape mode (home button on the left). Is this possible? EDIT: Attempted to add playerViewController.supportedInterfaceOrientations = .landscapeLeft Got error message "Cannot assign to property: 'supportedInterfaceOrientations' is a get-only property" import AVKit import AVFoundation UIViewController { var videoPlayer = AVPlayer() var playerViewController = AVPlayerViewController() override func viewDidAppear(_

iPhone/iPod - prevent font-size-changing

白昼怎懂夜的黑 提交于 2019-12-12 07:15:09
问题 I was wondering whether it is possible to prevent following behaviour: I've got a *.css file in which I define the font-size for my mobile-web-app. html,body { font-size:16px !important; } I didn't use any other font-size attributes in my files. Now, when I turn into the landscape mode, the font-size changes. How can I prevent or manipulate this behaviour. Do I have to use @media screen and (max-width: x px) { } or is there any other way? Thanks for sharing. 回答1: You may need to use extra

Change layout while orientation change at runtime in a fragment without recreating the view

浪尽此生 提交于 2019-12-12 07:15:02
问题 I try to develop a first app that download images from the net and show them in a gridview. The gridview is a fragment of a main Activity. The download process is made with an AsyncTask in the onCreate Function. In order not to download again the images while changing orientation, i set the android:configChanges="orientation|screenSize" in the Android Manifest. Then the onCreate function is only call once and everything's good ... except that i've got to make a few changes in the layout for

About trouble of device rotation using MTLabel

…衆ロ難τιáo~ 提交于 2019-12-12 05:48:44
问题 I have to use MTLabel Class for line-spacing of UILabel. ( refered sample code : https://github.com/Tuszy/MTLabel ) But Some problems exists. I'm making a iPad App. This app is able to rotate - landscape or portrait. I put UILabel and MTLable objects on view without IB. Whenever orientation of device is changed, width of text also changed. This result is not what I want. My code : #import "MTLabel.h" . - (void)viewDidLoad { [super viewDidLoad]; MTLabel *TitleFont = [[MTLabel alloc]

how to change layout on orientation change for titanium ipad

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-12 05:47:39
问题 I'm trying to make a spec on the ipad for an image gallery that has a 3x3 portrait layout but changes to a 3x2 layout on landscape. I'm trying to get the landscape or portrait grid on application load and then change also on orientation change but every time I do change my orientation the thumbnails flicker and the grid is all out of wack. http://pastebin.com/sLppSpS9 I'm thinking 'clear out or reset' the view, is there way to do that? 回答1: I've done similar with Windows, rather than views -

View Orientation changes

 ̄綄美尐妖づ 提交于 2019-12-12 05:14:22
问题 Update: I found why it was loading the same view the whole time. I now fixed that. It was a typo ControllerForSplitViews.m - (id)init { self = [super initWithNibName:@"ControllerForSplitViews" bundle:nil]; if(UIInterfaceOrientationIsLandscape(self.interfaceOrientation)){ self.view = landscapeView; } if(UIInterfaceOrientationIsPortrait(self.interfaceOrientation)){ self.view = portraintView; } [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; [[NSNotificationCenter

How to orient the faces of an Icosahedron in opengl?

那年仲夏 提交于 2019-12-12 04:54:54
问题 I saw the following code to make an icosahedron from the link http://www.glprogramming.com/red/chapter02.html #define X .525731112119133606 #define Z .850650808352039932 static GLfloat vdata[12][3] = { {-X, 0.0, Z}, {X, 0.0, Z}, {-X, 0.0, -Z}, {X, 0.0, -Z}, {0.0, Z, X}, {0.0, Z, -X}, {0.0, -Z, X}, {0.0, -Z, -X}, {Z, X, 0.0}, {-Z, X, 0.0}, {Z, -X, 0.0}, {-Z, -X, 0.0} }; static GLuint tindices[20][3] = { {0,4,1}, {0,9,4}, {9,5,4}, {4,5,8}, {4,8,1}, {8,10,1}, {8,3,10}, {5,3,8}, {5,2,3}, {2,7,3},

UIDeviceOrientationDidChangeNotification is returning UIOrientationLandscapeLeft for UIOrientationLandscapeRight

不问归期 提交于 2019-12-12 04:33:18
问题 I am registering my viewcontroller for UIDeviceOrientationDidChangeNotification and it's return wrong orientation of device. I am registering it in init function of viewcontroller [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(handleOrientationChangeNotification:) name: UIDeviceOrientationDidChangeNotification object: nil]; This is my device Notification Receiver method. -(void)handleOrientationChangeNotification:(NSNotification *)notification { if(IS_IPHONE) {

Problem with widgets and orientation in home application

最后都变了- 提交于 2019-12-12 04:08:35
问题 I am creating a home application and I finally got it to host widgets. The only problem is that when I change the orientation of the phone the widgets disappear and I have to add them all over again. I know that activities are recreated when the orientation changes but what should I do for the widgets to show up again? 回答1: Setting the background of an Activity See my answer there. Just do not write anything in the onConfigurationChanged() method. This is caused because the orintation changes