orientation

Height and width for landscape mode is showing wrong

二次信任 提交于 2019-12-11 19:24:35
问题 I have used this method for detecting the width and height of screen. But its showing the width as 768 and height as 1024 in portrait and landscape also. CGRect screenBounds = [[UIScreen mainScreen] bounds]; float widthfloat= screenBounds.size.width; float heightfloat= screenBounds.size.height; NSLog(@" width float %f",widthfloat); NSLog(@"height float %f",heightfloat); NSLog(@"width view %f \n height view %f", self.view.bounds.size.width, self.view.bounds.size.height); NSLog(@"width %f \n

Landscape orientation View Controller App Delegate

a 夏天 提交于 2019-12-11 19:24:10
问题 I'm trying to put only a View Controller in Landscape mode and the other ones in Portrait mode. First of all, I've tried to invalidate the rotation of each View Controller except for the one I want (With shouldAutoRotate false, only Portrait, ...), but with a Navigation Controller I have, it overlaps the Nav bar with the Status Bar, and I couldn't solve it. So after that, I've tried to clean everything I've done and enable or disable the Orientation ONLY from the AppDelegate. So here's a code

iPad shows at portrait but thinks it's landscape

半城伤御伤魂 提交于 2019-12-11 18:42:05
问题 My Storybuilder is designed with a portrait layout. When I start the app with my iPad already turned to horizontal, it's able to correctly detect it's in a horizontal position. But when I start the app with my iPad in a portrait position, it thinks it's in horizontal. However, every time I rotate it, the code is able to detect the correct orientation properly. - (void) viewDidLoad { [self updateForOrientation]; } - (void)updateForOrientation { if (UIInterfaceOrientationIsPortrait([[UIDevice

Playing a video with MPMoviePlayerController in Portrait WITHOUT Private API - Will I get rejected by Apple?

佐手、 提交于 2019-12-11 15:46:05
问题 It's my understanding that MPMoviePlayerController movies must play in landscape orientation because the "setOrientation:" function is private API. Well, it occurred to me that if I were to rotate the video 90 degrees in Final Cut and then re-render, the video would APPEAR to be playing in portrait orientation even though it was technically playing in landscape. I would simply have to disable the play controls to complete the effect (which is okay). Could I my app still face rejection if I

Different Orientation for Different Views?

核能气质少年 提交于 2019-12-11 15:32:57
问题 I'm making an iOS application that has an interface in the portrait view. However, when displaying web content I want the view to display in a landscape format, because I want the website test to display larger initially without the user needing to zoom. Can I tell the program so present this view only in landscape? Thank you. 回答1: looks like you want to force the orientation to landscape mode only.. heres my solution in MyViewController.h add this code on top of MyViewController's @interface

Android screen orientation: forcing landscape?

无人久伴 提交于 2019-12-11 14:53:50
问题 When I switch to a certain activity, I want that activity to show up in landscape mode. In my XML for that actvitiy: android:screenOrientation="landscape" most tutorials stated this is all that's needed, yet when that activity is switched to it doesn't automatically change orientation. fixed: the code needed to be in the manifest under the specific activity 回答1: In your activity tag, instead of just: android:screenOrientation="landscape" I would set: android:screenOrientation="landscape"

Setting LANDSCAPE orientation when printing

一个人想着一个人 提交于 2019-12-11 14:43:42
问题 I need to print an image. When I set orientation like printRequestAttributeSet.add(OrientationRequested.LANDSCAPE); all works fine. But when I set orientation inside print() method of Printable : public int print(Graphics graphics, PageFormat pageFormat, int pageIndex) throws PrinterException { if (pageIndex >= images.size()) return Printable.NO_SUCH_PAGE; image = images.get(pageIndex); // if image width>height --> Landscape, else --> Protrait if (image.getWidth(null) > image.getHeight(null))

iphone/ipad application - taking screen shot

回眸只為那壹抹淺笑 提交于 2019-12-11 13:25:16
问题 I successfully implemented an application that works on ipad as well as on iphone. In that I provided option to user to send the screen shot of the application as mail attachment. Even that is functioning well. But my code is taking screen shot irrespective of orientation. The image i'm getting is always in portrait mode. I want to take the screen shot depending on the orientation of ipad/iphone and send the image as attachment. I'm using following code to take the screen shot.

Animation when changing orientation

风流意气都作罢 提交于 2019-12-11 13:11:47
问题 Is it possible to perform animation when changing orientation? I have two layout for portrait and landscape. I want to perform a custom animation when changing orientation. If it's possible, how can I do that? In addition, when the screen change orientation, the children view rotate independently. For example, the textview rotates from left to right and the button rotate from right to left 回答1: I tried to use to rotate layout by using this sugesstion. It's just simulation, and the orientation

ToggleButton change state on orientation changed

狂风中的少年 提交于 2019-12-11 12:48:33
问题 I have a CustomButton class (extends LinearLayout ) where I inflate a layout which contains a ToggleButton (in reality this is more complex, but I simplified here the problem). public class CustomButton extends LinearLayout { private ToggleButton toggleOnOffButton; public CustomButton(Context context, AttributeSet attrs) { super(context, attrs); LayoutInflater.from(context).inflate(R.layout.custom_button_layout, this); } @Override protected void onFinishInflate() { toggleOnOffButton =