FAQ Database Discussion Community

Save excel as pdf changing its orientation to horizontal

I have an excel sheet with too many columns, so when I save it as a PDF the file its in too many pages and its not easy to read . I need to save the sheet as pdf but before I want to change its orientation to horizontal so...

StackPanel orientation set in code behind

I want to set my StackPanel Orientation property to vertical in code behind. I cant find Enum that I can set Vertical. var panel = new StackPanel(); panel.Orientation = Vertical; ...

Vuforia on Android mirrors target position after orientation change

I used VideoPlayback as the base of my application. I use SCREEN_ORIENTATION_SENSOR_LANDSCAPE on both vuforiaAppSession.initAR and activity orientation. If I start my application as landscape_left, it works fine, if I start it as landscape_right, it also works fine, but if on runtime I change the orientation, the positioning of the...

Changing orientation of android app at runtime

Is it possible to change screen orientation of an app programatically if it is fixed in androidmanifest.Xml.I have fixe portrait mode in AndroidManifest But in a particular case i want to change orientation to landscape and when it goes out of that case it must again change to portrait mode

How to open camera with a portrait orientation?

My whole android camera app is in portrait mode, so when I open the camera I need it to automatically open in portrait mode. When I open the camera now the preview is sideways. How do I set the camera preview to open in portrait mode so the preview will...

How to block Landscape Orientation mode in ONSEN-UI?

I am developing a ONSEN Application, in which I want to allow only a Portrait mode for the device and want to set off the Landscape mode. How to do that?

MKAnnotationView image orientation

I have a MKMapView in which I can have multiple ARDVenueAnnotationView (subclass of MKAnnotationView) with a custom image at same coordinates. Thus, these annotations overlap. What I have done for this, is to change the anchorPoint of the annotation view's layer. This is working as image below (4 centered annotations...

Lock Camera orientation to portrait

How can I prevent the android camera to switch orientation to landscape if I start the camera like this: Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); File imageFolder = new File (Environment.getExternalStorageDirectory(), Environment.DIRECTORY_DCIM); imageFile = new File (imageFolder, UUID.randomUUID().toString()+".png"); Uri uriImage = Uri.fromFile(imageFile); intent.putExtra(MediaStore.EXTRA_OUTPUT, uriImage); startActivityForResult(intent, 0); So I don't have a...

Swift - Supported Device Orientation for MPMoviePlayerViewController

Ok so on my app when the user clicks a button a video is streamed from a server and it opens in the MPMoviePlayerViewController. This is the code for when the user clicks the button: @IBAction func WatchPressed(sender: AnyObject) {self.presentMoviePlayerViewControllerAnimated(movieViewController)} Basically I want to know whether or not I could...

How to detect orientation of recorded video in android

Hello friends I am new in android developing and i am facing some problem while i am working with camera in my app. I am developing app and in this app i am using the inbuilt functionality of camera. In my app camera will perform the task to capture video...

How to lock orientation just for one view controller?

Can I set a portrait orientation and lock orientation just in one controller? I did try: override func supportedInterfaceOrientations() -> Int { return Int(UIInterfaceOrientationMask.Portrait.rawValue) } override func shouldAutorotate() -> Bool{ return false } but it doesn't help me. Must I to add anything else?...

How to disable landscape orientation on a single view at iOS 7/8

I enabled the landscape orientations for my app at the general target settings: This is all working fine - the app is available in all selected orientations... Now I want to disable the landscape mode on only one single view. I tried the following at the specific view controller: -...

iOS+SpriteKit: How to force portrait mode?

I'm currently working on a SpriteKit game for iOS 7+ and XCode 6. The game should always be presented in portrait mode. So far I have implemented these methods in my view controller: - (BOOL)shouldAutorotate { return NO; } - (NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskPortrait; } This works fine as long...

Android orientation change in video player

I have a Video Player. And want to enable both landscape and portrait orientation. But the problem is that player downloading the file every time, when orientation is changed. I've tried to use "onCofigurationChange", but it is still not working. How I can solve the problem? P.S. I have already...

Strange orientation behaviour of MovieViewController

So in my app there is an MPMoviePlayerViewController which allows the user to view a video. They are able to watch the video in the MPMoviePlayerViewController in any orientation and once they are finished and hit "done" they return to the previous view controller but in portrait only. The problem...

Constraints are not working as expected in landscape orientation

I test very simple layout with autolayout use storyboard only(no code any where) i dropped the Button object wAny, hAny and then switch size class to wCompact, hAny and add Constraint 'Center Horizontally in Container' & 'Top Space to Top layout guide'. next i switch size class to wAny, hCompact...

Controlling Auto Rotation with toggle?

I want to create a toggle button through which I can enable/disable auto rotation. I've tried this: public void arclick(View view) { if (arclick.isChecked()) android.provider.Settings.System.putInt(getContentResolver(), android.provider.Settings.System.USER_ROTATION, 90); else android.provider.Settings.System.putInt(getContentResolver(), android.provider.Settings.System.USER_ROTATION, 0); } But it's not working actually. Any ideas? Thanks in advance!!! P.S: The selected orientation should be applied to...

how can i set landscape orientation when playing a video from webview

i have a webview with a video link, the app is only portrait orientation but i need to change orientation when the video is in fullscreen and use all screen. Thanks for your help.

iOS 8.3 keyboard orientation bug

I am facing a strange iOS 8.3 issue which shows a keyboard on a wrong orientation like this (the view controller is in Landscape mode, but the keyboard show up in Portrait mode): I can trigger this issue by following these steps: Create 2 UIViewController subClass: ViewControllerA and ViewControllerB in...

IOS XIB storyboard Launch Screen file displays wrong orientation of an image inside

I am using js based app with the support of ejecta kitchen. My problem is an image which i have set on the MainWindow that displays wrong orientation or in other words it displays fixed orientation. My application require everything to be displays in landscape mode but XIB file display...

I never get notified when device rotation is in .PortraitUpsideDown

I have the following method inside my only ViewController. override func willAnimateRotationToInterfaceOrientation(toInterfaceOrientation: UIInterfaceOrientation, duration: NSTimeInterval) { println("willAnimateRotationToInterfaceOrientation") super.willAnimateRotationToInterfaceOrientation(toInterfaceOrientation, duration: duration) switch (toInterfaceOrientation) { case .Portrait: println(".Portrait") case .PortraitUpsideDown: println(".PortraitUpsideDown") case .LandscapeRight: println(".LandscapeRight") case .LandscapeLeft:...

Phonegap build, enable secondary portrait orientation?

Phonegap build by default apparently excludes rotation to secondary portrait orientation. Is it possible to enable it? Using PhoneGap build service and iPad....

MATLAB: changing montage orientation of 2 images

I'm trying to use MATLAB to open a montage of just two images placed top and bottom. MATLAB defaults to a left/right orientation. I've tried montage(images, 'Size', [2 1]) but this still gives me the left/right orientation but just adds a blank row underneath.

Issue with portrait display after playing landscape video

I have an iPhone app that displays files to the user (videos, pdf files and documents). When you click on a file thumbnail in my FileViewController I call UIDocumentInteractionController to present the file to the user. All app screens are locked to portrait orientation apart from the document controller, that...

Add value to WP Attachment Meta Data

I would like to let Wordpress calculate the aspect ratio & orientation when the media is uploaded instead of doing this in the templates. Then I can call images and ask for image.orientation which will give me 'portrait' or 'landscape' as a value. Example, how it would look like after...

Simple way to redraw view programatically when device orientation changes

I'm new to iOS development and for my assignment, I'm tasked changing updating the ViewController programmatically when the device's orientation changes. I've found a snippet of an answer here, but it doesn't get the job done. I tried adding this to the viewWillLayoutSubviews of my View Controller, but all I...

Showing Logcat message on screen orientation change

I want to know when the orientation changes on my device using Logcat but it is not showing me any output (I'm using Android Studio). I've added the screenSize attribute to my AndroidManifest.xml but this doesn't fix the issue. Below is my manifest file: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.danishrehman.orientationchangenotification"...

How to design an iOS app which runs only in landscape mode in ipad and portrait in iPhone?

I am new to iOS development.I am making an app which runs on iPad and iPhone.I am using universal storyboard.I want the phone to work only in portrait mode and iPad to work only in landscape mode.How to do the design for ipad in landscape?Can we rotate the storyboard and...

Android easiest way to set layout for orientation

I add android:configChanges="orientation|keyboardHidden|screenSize" in manifest and create two xml activity_main(port) and layout(land) under res folder.I want to set it change between two layout when I rotate ,how to edit my code? Thanks After I change twice the method under oncreate is not works. <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent"...

IOS8 Autolayout with relative width / height

I need to autolayout a storyboard UIView with a single UIControl. The UIControl should be centered, needs to have a aspect ratio of 1:1 and should always use 90% of the superviews width or height depending on the device orientation without clipping. I added 4 constraints Center Y Alignment -...

Change UIViews position when iPhone orientation changes

I'm trying to change the position of UIViews when the iPhone's orientation is changed. It's similar to this question; but instead of 3 views, I'll be having 2 views. When the iPhone is in portrait mode, I want the views to be one on top of the other. When in...

How to make Android layout proportional regardless of screen size and orientation

This is my first post here. I just learned Android programming and come to this problem. I have searched a bit and found some solutions but I couldn't make my code works. So I want to know which part of my code or implementation is wrong. So, the problem is...

Storyboard orientation Xcode 6.3

I need to design an app in landscape mode. I selected the ViewController and went to the attribute inspector and selected the orientation to Landscape but the controller view in storyboard doesn't become in the landscape mode. Please suggest what I am doing wrong. I am using Xcode 6.3 Thanks...

Via rotate orientation change layout without reload OnCreate()

I have 3 Layouts in different folders : 1.layout/HomeLayout.axml (where layout is an folder for layouts and HomeLayout.axml is an global axml file). 2.layout-large-port/HomeLayout.amxl (where layout-large-port is an folder for large(dimension of display) portrait and HomeLayout.axml is axml file). 3.layout-large-land/HomeLayout.axml(where is layout-large-land is an folder for large(dimension of display) landscape...

UIImageView not presenting image in correct orientation in iPhone

I have tried alot of solutions but non has worked yet Heres what i am doing: if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) { UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init]; imagePicker.delegate = self; imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera; imagePicker.modalPresentationStyle = UIModalPresentationCurrentContext; //imagePicker.allowsEditing = YES; NSOperatingSystemVersion ios8_0_0 = (NSOperatingSystemVersion){8, 0, 0}; //This was suggested...

iOS 8 Game Center LogIn Orientation

I am trying to integrate Game Center into my game. So I receive the the viewcontroller from the game center and I present it. My game is only landscape but when i launch the game the Game Center login is in portrait. My game's viewcontroller has supportedOrientations and preferredOrientation return...