landscape-portrait

How to disable landscape mode?

拜拜、爱过 提交于 2019-12-08 11:00:02
问题 i'n my application i have Fragment's in a viewPager i know how to disable the landscape from manifest and from java like : android:configChanges="orientation" android:screenOrientation="portrait" //////////////////////////////// setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); (setContent.....) but if i hold my device in landscape mode and then i running the application the application load in landscape and the portarti mode not working. why is that? Ok i figure it out my

What is the proper way to handle image rotations for iphone/ipad?

我的梦境 提交于 2019-12-07 16:38:23
问题 I have 2 images, one in portrait mode, and the other in landscape mode. What is the best way to switch these images when a mobile device view rotation takes place? Currently I just display the portrait image. And when the device rotates to landscape mode the portrait image is simply stretched. Should I be checking within the orientation rotation handler and simply reset the image to the proper orientational image (i.e. set it manually based on the orientation)?? Thanks! 回答1: I found three

MPMoviePlayerController fullscreen in landscape mode in a portrait project

六眼飞鱼酱① 提交于 2019-12-07 14:35:47
问题 in my app i have selected only the portrait mode in the project setting: and i use it in this way: player = [[MPMoviePlayerController alloc] init]; [player setContentURL:videoURL]; [player play]; but when i display a video using MPMoviePlayerController in full screen and i try to rotate it, doens't rotate, and stay in portrait , there is a simple way without enable the landscape mode in the project setting, to active the landscape in fullscreen? 回答1: You have 2 options: Enable landscape mode

Thumbnail generation with Ghostscript rotates my device size definition for landscape pdf pages

三世轮回 提交于 2019-12-06 11:22:12
I want to use GS to generate thumbnails from pdf files. The thumbnail must fit a 90x120 pixel rectangle The image should not be rotated The image should be resized to fit the rectangle with keeping aspect ratio I use the following command: gswin32 -dPDFFitPage -dPARANOIDSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=0 -dDEVICEWIDTH=90 -dDEVICEHEIGHT=120 -dORIENT1=true -sDEVICE=jpeg -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sOutputFile=output.%d.jpg input.pdf Result: If I use some PDF with portrait pages like this example , which you can download, then the

What is the proper way to handle image rotations for iphone/ipad?

孤街醉人 提交于 2019-12-06 01:51:20
I have 2 images, one in portrait mode, and the other in landscape mode. What is the best way to switch these images when a mobile device view rotation takes place? Currently I just display the portrait image. And when the device rotates to landscape mode the portrait image is simply stretched. Should I be checking within the orientation rotation handler and simply reset the image to the proper orientational image (i.e. set it manually based on the orientation)?? Thanks! Shamsudheen TK I found three ways.I think the last one is better 1: Autoresizing Example: UIImageView *myImageView=[

Handling multiple tabs during landscape and portrait in android

梦想的初衷 提交于 2019-12-06 01:46:59
I have specified different layouts for landscape and portrait using layout and layout-land, my application have multiple tabs. Each time when changing from portrait to landscape or landscape to portrait screen changes to 1st tab even selected tab is different one. How can we solve this problem. You can use onRetainNonConfigurationInstance() to solve this issue. public void onCreate(Bundle savedInstanceState) { .... lastTab = (Integer) getLastNonConfigurationInstance(); ..... if(lastTab != null) { tabs.setCurrentTab(lastTab); } } public Object onRetainNonConfigurationInstance() { return tabs

AlertDialog Displays Landscape-Sized View with Orientation in Landscape

♀尐吖头ヾ 提交于 2019-12-05 06:10:18
问题 My app's main activity is set in the manifest to always be in portrait view. This works fine when I load the app onto the tablet. However, when I use my menu button and click "Setup", which opens an AlertDialog that inflates an xml layout, the tablet will display the left 2/3 or so of the entire dialog. The rest of it goes offscreen to the right. This case only occurs if I install my app on the tablet while holding it in landscape mode or if I turn the tablet to landscape mode while the app

Combine layout_weight and maxWidth for views

假装没事ソ 提交于 2019-12-05 00:59:04
I'm trying to make my layouts more landscape friendly, and a common pattern I have is to add a LinearLayout with some buttons (e.g. OK | Cancel) and just set a value for layout_weight so that the space is evenly distributed. The problem is that when you use a phone or (especially) a tablet in landscape mode, you end up with humongous buttons that look ridiculous. I tried setting maxWidth on the buttons and on the linear layout but to no avail. What would be the easiest way to achieve this? Namely, setting a maximum horizontal size for the view so that it does not grow to the whole width. I

confused by the UIImageOrientation of portrait/landscape mode photo

我是研究僧i 提交于 2019-12-04 11:39:00
I take two photos using the ios`s system camera,which one is in portrait mode and another is in landscape mode, then I use imagePicker to pick them out in my app like this: -(void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info{ UIImage* sourceImage = [info objectForKey:UIImagePickerControllerOriginalImage]; UIImageOrientation imageOrientation = sourceImage.imageOrientation; NSLog(@"%d",imageOrientation); } Note that I NSLog out the UIImageOrientation value of the image I just picked out. the result is the value for the portrait mode

Supporting Universal App with Portrait Orientation on iPhone and Landscape+Portrait on iPad

前提是你 提交于 2019-12-04 07:11:25
I need my app to be compatible both on iPad and iPhone. Its having a tabbarController as the rootViewController. In iPad I need it to be available both on Landscape and Portrait. In iPhone though I need the rootView to be Portrait itself and i do have some viewsControllers, which are being presented on the tabbarController, which need to be available both in landscape and Portrait (e.g. a viewController used to play videos from Youtube). So I am locking the rotation of the tabbarController as follows (In the UITabbarController Subclass). # pragma mark - UIRotation Methods - (BOOL