landscape-portrait

Child View Controller to Rotate While Parent View Controller Does Not

走远了吗. 提交于 2019-11-29 20:28:21
What I am Trying to Do: Parent View that is managed by Parent View Controller SHOULD NOT ROTATE . Child View that is managed by Child View Controller SHOULD ROTATE to all orientations. What I Have Tried: ParentViewController override func supportedInterfaceOrientations() -> UIInterfaceOrientationMask { return .Portrait } override func shouldAutorotate() -> Bool { return true } fun addChildViewController() { let storyBoard = UIStoryboard(name: "Main", bundle: nil) self.childViewController = storyBoard("Child View Controller") as? ChildViewController self .addChildViewController(self

How can I use constraints AutoLayout with to specify a different layout on landscape vs. portrait without using code?

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-29 19:08:09
问题 I have an iPad app that features a login screen, with the login controls contained within a UIView. When the iPad is in portrait orientation I have the Login UIView near the bottom and center of the app, pretty much right above where the keyboard will be, and the company logo is in a UIImageView centered across the top. I'm using AutoLayout constraints to keep the company logo gravitated to the top and right, and the Login UIView gravitated to the bottom and right. (source: chattypics.com)

How to lock screen in portrait/landscape in iPhone?

一世执手 提交于 2019-11-29 08:48:41
My Application supports all orientation but in few cases i want to lock the screen in portrait/landscape mode. In my Application i have two kind of pdf document. one is in portrait document and other is landscape document . i want to open portrait document in portrait view only, and landscape document in landscape view only. i want to do like this: if my application is open in landscape view and i click on the portrait document so it must rotate in portrait view and same like this for landscape if my application is open in portrait view and when i click on the landscape document it must be

How to set page orientation for Word document?

陌路散爱 提交于 2019-11-29 07:20:59
I use Apache POI XWPF to create and handle MS Word documents. But I didn't find in the documentation how to change the page orientation. Apparently this way should make it: XWPFDocument doc = new XWPFDocument(); CTDocument1 document = doc.getDocument(); CTBody body = document.getBody(); if (!body.isSetSectPr()) { body.addNewSectPr(); } CTSectPr section = body.getSectPr(); if(!section.isSetPgSz()) { section.addNewPgSz(); } CTPageSz pageSize = section.getPgSz(); pageSize.setOrient(STPageOrientation.LANDSCAPE); But this method doesn't work properly. I can set the page orientation to landscape,

android camera portrait orientation

瘦欲@ 提交于 2019-11-28 21:53:36
I am using camera in my app. I am just using intent to start camera Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri); startActivityForResult(cameraIntent, 101); The captured image automatically comes in landscape view . How do i make camera to capture images in portrait view anujprashar If device has v2.2 or above you can rotate camera orientation to portrait using camera.setDisplayOrientation(90) . In devices below to v2.2 the camera will only display in landscape orientation and thus image will

Resize a view when a keyboard appears (iOS)

陌路散爱 提交于 2019-11-28 20:47:24
I realize there are many similar solutions, such as TPKeyboardAvoiding , Apple's famous solution , and various suggestions involving the use of UIScrollView. In my case, I need to resize a view to accommodate the keyboard rather than scroll or move it. This solution comes closest to what I'm trying to achieve, so it was my basis. However I'm having an issue making things work in landscape mode. My method that resizes the view when the keyboard appears is this: - (void)keyboardWillShow:(NSNotification *)note { NSDictionary *userInfo = note.userInfo; NSTimeInterval duration = [[userInfo

Child View Controller to Rotate While Parent View Controller Does Not

为君一笑 提交于 2019-11-28 17:08:54
问题 What I am Trying to Do: Parent View that is managed by Parent View Controller SHOULD NOT ROTATE . Child View that is managed by Child View Controller SHOULD ROTATE to all orientations. What I Have Tried: ParentViewController override func supportedInterfaceOrientations() -> UIInterfaceOrientationMask { return .Portrait } override func shouldAutorotate() -> Bool { return true } fun addChildViewController() { let storyBoard = UIStoryboard(name: "Main", bundle: nil) self.childViewController =

How to lock screen in portrait/landscape in iPhone?

流过昼夜 提交于 2019-11-28 02:12:39
问题 My Application supports all orientation but in few cases i want to lock the screen in portrait/landscape mode. In my Application i have two kind of pdf document. one is in portrait document and other is landscape document . i want to open portrait document in portrait view only, and landscape document in landscape view only. i want to do like this: if my application is open in landscape view and i click on the portrait document so it must rotate in portrait view and same like this for

How to set page orientation for Word document?

断了今生、忘了曾经 提交于 2019-11-28 00:57:36
问题 I use Apache POI XWPF to create and handle MS Word documents. But I didn't find in the documentation how to change the page orientation. Apparently this way should make it: XWPFDocument doc = new XWPFDocument(); CTDocument1 document = doc.getDocument(); CTBody body = document.getBody(); if (!body.isSetSectPr()) { body.addNewSectPr(); } CTSectPr section = body.getSectPr(); if(!section.isSetPgSz()) { section.addNewPgSz(); } CTPageSz pageSize = section.getPgSz(); pageSize.setOrient

Portrait and Landscape mode in iOS6

最后都变了- 提交于 2019-11-27 21:41:34
When updating my app to iOS6 standard the portrait / landscape is gone. Ir worked perfectly when I was building with Xcode 3. But now using latest Xcode and latest SDK the rotation is gone and it is always in portrait mode. No matter what I put in "Supported interface Orientations". And the code I used to get rotation before seems to have no effect at all. I had these lines. - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation { switch (toInterfaceOrientation) { case UIInterfaceOrientationPortrait: case UIInterfaceOrientationLandscapeLeft: case