w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Screen orientation forced to portrait, but still, the activities will rotate to landscape when tilted!! How to force portrait mode?
May be this will help In your manifest file after your main activity write below line android:screenOrientation="portrait" Or in your coding after setContentView() add this line.. setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);

Categories : Android

How to change UINavigationBar background image when iPad goes from portrait mode to landscape mode?
You must use: - (void)viewDidLoad { [super viewDidLoad]; [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(orientationChanged:) name:@"UIDeviceOrientationDidChangeNotification" object:nil]; } - (void) orientationChanged:(id)object { UIInterfaceOrientation interfaceOrientation = [[object object] orientation]; if(orientation == UIInterfaceOrientationPortrait) { NSLog(@"orientation is UIInterfaceOrientationPortrait"); // Assuming "self" is a view controller pushed on to a UINavigationController stack [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"portrait_

Categories : Objective C

Portrait mode and landscape mode views display adjustment with phone size
You simply create 2 different layout files. You should read the developer guides on this subject. Basically you make 2 res/layout folders: res/layout and res/layout-land Then you add a layout for landscape to the land folder and the portrait version to the other.

Categories : Android

UIImagePickerController in portrait mode inside UIPopoverController when view is locked for landscape mode
you can do this with Subclassing UIImagePickerController @interface UAImagePickerController : UIImagePickerController { } @end @implementation UAImagePickerController - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation { return UIDeviceOrientationIsPortrait(toInterfaceOrientation); } @end

Categories : IOS

Email composer show in landscape mode when restrict application in portrait mode (android +phonegap )
Actually you restricted particularly an Activity to be in a portrait mode, it will be apply only your SplashScreenActivity. For other Activity it will remain as default. If you want this for other activity also you have to write android:screenOrientation="portrait" in all activity, Try This android:screenOrientation="portrait" android:configChanges="orientation"

Categories : Android

How to load a UIViewController in landscape mode if its parent is in Portrait mode?
In your child UIViewController set these two methods: - (BOOL)shouldAutorotate { return NO; } - (NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskLandscapeLeft; } In parent UIViewController do: [self.navigationController presentViewController:controller animated:YES completion:nil]; instead of: [self.navigationController pushViewController:controller animated:YES]; If you want to present navigation bar in child: DetailViewController *controller = [self.storyboard instantiateViewControllerWithIdentifier:@"DetailViewController"]; controller.title = @"Child"; You'll have to subclass UINavigationController with the two methods mentioned above instead in the child view controller. MyNavigationController *nav = [[MyNavigationController alloc] ini

Categories : Iphone

ViewController from .xib file is loading in portrait mode and not in landscape mode in iOS
You may need to use the below methods in the NextLandscapeViewController -(BOOL)shouldAutorotate { return YES; } -(NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskLandscape; } If the control doesn't reach these methods in View Controller, then you need to subclass the Navigation Controller.

Categories : IOS

Navigation menu disappears in landscape mode if the user clicks the toggle button in portrait mode in my responsive website
The problem is jQuery's .slideToggle() method dynamically adds a style: none to the element you are toggling, straight into the tag. So, it takes precedence over your media query rules set in your CSS. To overcome this issue, in your media query targeting devices with screen widths above 960px, add an !important to the display rule for the #main-nav. ul#main-nav { line-height:1; list-style:none; display:block !important; overflow:visible; } Another thing I noticed was your determining factor for adding a listener to the click event on your navigation toggle. If it's dependent on the #main-nav's float attribute, then when the page is first loaded in landscape then switched to portrait the slide toggle will not work, because no listener has been attached to the #nav-collap

Categories : Javascript

How to set Portrait mode when it's in landscape?
Try this:: - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { if (interfaceOrientation==UIInterfaceOrientationPortrait) { return YES; } return NO; } Hope it Helps!!

Categories : Iphone

confused by the UIImageOrientation of portrait/landscape mode photo
iPhone's camera save photo regardless to the device orientation but it adds a metainformation to image to allow this image rendered properly. imageOrientation describes the amount of degrees the image should be rotated to be properly rendered.

Categories : IOS

Getting same screen width and height for portrait and landscape mode
That's because you are using mainScreen and do not take into account the devices orientation at all. It's going to end up returning the same value all the time unless you implement a method logging it in all orientations. Try something like this : [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; if (([[UIDevice currentDevice] orientation] == UIDeviceOrientationLandscapeLeft) || ([[UIDevice currentDevice] orientation] == UIDeviceOrientationLandscapeRight)) { //log here } else { // log here }

Categories : IOS

Search Bar Loses FirstResponder when rotated from Portrait to Landscape mode
inside the method that deals with roation of the view - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation; check to see what interface you are in - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight) { [searchBar becomeFirstResponder]; } } hope that helps!

Categories : IOS

$(window).width() returning same value in portrait/landscape mode of iPhone
<meta name="viewport" content="width=device-width; initial-scale=1.0;"> Add that instead, I've tested it on my iPhone and it's output is correct. Tested it with $(window).width();

Categories : Jquery

Convert landscape image to portrait mode when select from UIImagePickerController in iOS6
You need to add autoresizing mask to your image view. Try this:- yourImageView.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;

Categories : Iphone

Round corner full bottom screen for portrait & landscape mode?
For setting your views to both orientation at the bottom of the screen do this: - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { CGRect screenFrame = [[UIScreen mainScreen] bounds]; [self.brcLeft setFrame:CGRectMake(0.0, screenFrame.size.height - self.brcLeft.frame.size.height , 12.0, 12.0)]; [self.brcRight setFrame:CGRectMake(result.width-12.0, screenFrame.size.height - self.brcRight.frame.size.height , 12.0, 12.0)]; return YES; } and for rounded Corners: #import <QuartzCore/QuartzCore.h> write this in your viewDidLoad self.brcLeft.layer.cornerRadius = 2; self.brcLeft.layer.masksToBounds = YES; self.brcRight.layer.cornerRadius = 2; self.brcRight.layer.masksToBounds = YES;

Categories : IOS

Android 2.3 & above: How to draw 2 squares of biggest size in either portrait or landscape mode
Might be you want something like this: <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:weightSum="2"> <ImageView . . . android:layout_weight="1" /> <ImageView . . . android:layout_weight="1" /> </LinearLayout>

Categories : Android

How can I change an element's height based on a mobile device being in landscape vs. portrait mode?
This website might be helpful to you... From that I wrote this code which I haven't tested yet but should help. // Define an event handler function to execute when the device orientation changes var onOrientationChange = function() { // The device is in portrait orientation if the device is held at 0 or 180 degrees // The device is in landscape orientation if the device is at 90 or -90 degrees var isPortrait = window.orientation % 180 === 0; var orientation = isPortrait ? 'portrait' : 'landscape'; var viewPortWidth; var viewPortHeight; if (typeof window.innerWidth != 'undefined') { viewPortWidth = window.innerWidth, viewPortHeight = window.innerHeight } $('#footer').css('margin-top', viewPortHeight); alert('You are now viewing i

Categories : Javascript

How can I prompt user to rotate device if in a certain mode landscape or portrait, similar to GameInformer App
I see you tagged the question with responsive-design so thought I could offer a solution that doesn't require Javascript and can be done with just CSS. Knowing that there are two different screen sizes available when switching between landscape and portrait mode, you can use a media query to show and hide an overlay: HTML: <div id="content"> <p>Integer velit nulla, condimentum vitae risus ut, rhoncus vulputate quam. Fusce lacus elit, accumsan eu dolor vel, scelerisque pretium turpis. Vivamus ac lectus vitae enim lacinia fringilla vel id tellus. Curabitur pharetra tortor eget risus ornare scelerisque. Morbi tempus et felis vitae venenatis. Suspendisse vitae ultrices est, nec sagittis arcu.</p> </div> CSS: #rotate { display: none; } @media screen and (m

Categories : Jquery

Show Camera in half of the screen in portrait when rest of the application is in landscape mode
I think you won't be able to achieve desired behaviour with UIImagePickerController since it is a special kind of controller. You can take a look in media capture guide. You can then create AVCaptureVideoPreviewLayer with your own size and present it how you like though you will need to write your own code for capturing images. This is the Apple doc for that. http://developer.apple.com/library/mac/documentation/AudioVideo/Conceptual/AVFoundationPG/Articles/04_MediaCapture.html This is a good presentation with code snippets. http://www.slideshare.net/invalidname/capturing-stills-sounds-and-scenes-with-av-foundation You might also find this question useful. AVCaptureVideoPreviewLayer orientation - need landscape

Categories : IOS

Application crash while switching changing the mode (Landscape & portrait )in jquery mobile android
Add android:configChanges="orientation|keyboardHidden" to activity tag in your android manifest file. Refer these Phonegap app crashes when switched orientation even with AndroidManifest changes http://groups.google.com/group/phonegap/msg/c771fffc4dd9daaf http://community.phonegap.com/nitobi/topics/app_crashes_on_android_during_orientation_change If that won't work, better post your android manifest code.

Categories : Jquery

How to auto rotate first view only portrait and second view only landscape mode ios6
Firstly is this within a UINavigationController. If so you should subclass UINavigationController and add the following to your subclass: #pragma mark - Auto Rotation -(BOOL)shouldAutorotate { return [self.topViewController shouldAutorotate]; } -(NSUInteger)supportedInterfaceOrientations { return [self.topViewController supportedInterfaceOrientations]; } Then in each VC you can override the methods for which require and which do not require autorotation.

Categories : IOS

IOS 6 Orientations - Only One Viewcontroller supports Landscape & Portrait orientation - else ONLY Portrait
You can read this: Multiple Orientations This is what I do: In all viewcontrollers: #pragma mark Orientation handling - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown); } -(BOOL)shouldAutorotate { return YES; } -(NSUInteger)supportedInterfaceOrientations { return (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown); } The only viewcontroller: - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation { return YES; } Hope this helps..

Categories : IOS

How to set portrait and landscape view?
You can put the menu elements in a Grid with 4 columns, each of them having a Width of "*". This way the menu spans the screen width. Or put them in a StackPanel which has a HorizontalAlignment of "Center". This way the menu has a symmetric margin. But instead of doing this, you should read best practices, design guidelines and similar stuff: the menu of a WP app id ALWAYS on the edge of the hardware buttons. It doesn't use gradients or even gray scales. If you don't follow these rules, your app will feel "wrong" to WP users and will be rated badly.

Categories : Xaml

How to change CSS portrait to landscape in iphone?
You don't need JavaScript to achieve this functionality. Use CSS media queries: @media only screen and (orientation : portrait) { /* Portrait styles */ } @media only screen and (orientation : landscape) { /* Landscape styles */ } Or, you could set specific widths for iPhone landscape/portrait if you wished. @media only screen and (min-width:320px) and (max-width:479px) { /* Portrait styles */ } @media only screen and (min-width:480px) { /* Landscape styles */ }

Categories : Iphone

How to convert "onOrientationChanged" value to landscape and portrait
you can get orientation by using this if(getResources().getConfiguration().orientation==Configuration.ORIENTATION_PORTRAIT) { // do your stuff } else { // do your stuff }

Categories : Android

how to Calculate whether an image is landscape or portrait
You can simply compare width and height of the image. var someImg = $("#someId"); if (someImg.width() > someImg.height()){ //it's a landscape } else if (someImg.width() < someImg.height()){ //it's a portrait } else { //image width and height are equal, therefore it is square. }

Categories : Jquery

need of two xibs for my portrait and landscape modes
The answer is NO . You need not use 2 Xib's. Please go through the following links :- Easiest way to support multiple orientations? How do I load a custom NIB when the application is in Landscape? Different Xib's for Potrait and Landscape mode for iPad http://www.theappcodeblog.com/2011/03/30/orientation-change-tutorial-change-the-view-when-the-orientation-changes/ Also ios 6 offers new methods like shouldAutoRotate etc. You might want to go through them too.

Categories : Iphone

Working with AutoLayout in Portrait and Landscape
Yes, it is definitely possible to do this with Auto Layout. Through a series of steps, that I think might be too long to post as an answer, you can retain the spacing between your ImageViews and keep the alignment of the text the same. Essentially, you will have to pin a corner of each ImageView and remove some constraints so that it doesn't automatically compress the spacing when you change the orientation. Full explanation on how to do this (pretty much exactly what you are asking for) is explained in this tuorial. You can find it about halfway through the page. Hope this is what you were looking for.

Categories : IOS

Orientating app's view to landscape and portrait
Based on your controls frame you need to adjust the position of our controls while rotating the device. Access controls which is in our view controller like this. [self.button setFrame:]; Access the sub view controls frame like this: [self.subviewname.control setFrame:]; Based on the orientation you need to handle the frames. You can use auto re-sizing also. Update: Make sure whether your sub view is added properly in your view controller like this : [self.view addSubView:self.mysubView]; Increase the score of your sub view(HeaderView) as well.

Categories : IOS

iOS App: Window rotation always Portrait instead of Landscape
In Xcode in the files pane click on your project and then select target from right pane. Then in Summary tab see supported orientations. Only select Landscape right. Also you can implement -(NSUInteger)supportedInterfaceOrientation { return UIInterfaceOrientationMaskLandscapeRight; } in your app delegate

Categories : IOS

how to fit UILabel in portrait and landscape and also vertical alignment?
you can use flexible height for fixing vertical alignment with OR operator Label.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight; EDIT: Label.autoresizingMask=UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleTopMargin|UIViewAutoresizingFlexibleLeftMargin;

Categories : IOS

make orientation of an activity both landscape and portrait
this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); As the device has an accelerometer, you can easily switch between both I hope this will help.

Categories : Android

Photo picker. Portrait turns to landscape
You have to get the exif rotation of the pic, like this and arrange youur bitmap accordingly public static int getExifRotation(String imgPath) { try { ExifInterface exif = new ExifInterface(imgPath); String rotationAmount = exif.getAttribute(ExifInterface.TAG_ORIENTATION); if (!TextUtils.isEmpty(rotationAmount)) { int rotationParam = Integer.parseInt(rotationAmount); switch (rotationParam) { case ExifInterface.ORIENTATION_NORMAL: return 0; case ExifInterface.ORIENTATION_ROTATE_90: return 90; case ExifInterface.ORIENTATION_ROTATE_180: return 180; case ExifInterface.ORIENTATION_ROTATE_270:

Categories : Android

Launch app Iphone portrait, and Ipad landscape
This works!!! for IOS 6 -(NSUInteger)supportedInterfaceOrientations{ if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) return UIInterfaceOrientationMaskPortrait; else return UIInterfaceOrientationMaskLandscape; } - (BOOL)shouldAutorotate { return YES; }

Categories : Iphone

How to design ui in both portrait and landscape in ios5 using storyboard
If you want design UI using storyboard, In latest iOS version there is option of Out Layout. Using Autolayout you can manage UI for both modes. Hope this will help you http://www.raywenderlich.com/20881/beginning-auto-layout-part-1-of-2 Or Other alternate provided on iPhone Storyboard: different scene for portrait and landscape When you add a view controller to the storyboard it comes with a view. Call that the container view. Add two views to the container view: a portrait view and a landscape view. Set the dimension of the portrait view and the landscape view appropriately using the size inspector. Add buttons, more views, labels or whatever to the portrait and landscape views as needed for your application. Then when the orientation changes hide one view and show the other.

Categories : Iphone

Alternative iOS layouts for portrait and landscape using just one .xib file
There is no automatic way to support that since it is against Apple design. You should have one ViewController supporting both orientations. But if you really want to do so you need to reload xib's on rotation events and load different nib files. -(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { [[NSBundle mainBundle] loadNibNamed:[self nibNameForInterfaceOrientation:toInterfaceOrientation] owner:self options:nil]; [self viewDidLoad]; } - (NSString*) nibNameForInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { NSString *postfix = (UIInterfaceOrientationIsLandscape(interfaceOrientation)) ? @"portrait" : @"landscape"; return [NSString stringWithFormat:@"%@-%@", NSStringFromClass([self

Categories : IOS

Make Dialog in landscape or portrait orintation
Wrap your entire layout in a <ScrollView>, it just gets truncated because the screen isn't 'high' enough. If you layout would be bigger in height, the first screen would be cut off too.

Categories : Java

Status Bar remains in landscape, while UIInterfaceOrientation is only portrait
What you have in AppDelegate function - (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window{ } By default, an app and a view controller’s supported interface orientations are set to UIInterfaceOrientationMaskAll for the iPad idiom and UIInterfaceOrientationMaskAllButUpsideDown for the iPhone idiom. Check for selected viewcontroller in supportedInterfaceOrientationsForWindow function and then set it to Portrait orientation.

Categories : IOS

How to easily create a landscape xml based on portrait one?
I just copied and pasted your layout example in Android Studio, and after remove @drawable tags, I saw it perfectly proportioned in landscape layout, just pushing the portrait to landscape mode button. So If may I suggest you, a posible solution is that you play with the resolution from the images in its different sizes (/res/drawable-* folders). I mean, just change your drawable tags from the landscape.xml to map into images that accurately render the horizontal layout. Hope this help

Categories : Java

Swipe Gesture for LS Mode & Portrait Mode
You need to add this to your view: - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. UISwipeGestureRecognizer *swipe1 = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeToggle:)]; swipe1.direction = UISwipeGestureRecognizerDirectionUp ; [self.view addGestureRecognizer:swipe1]; [swipe1 release]; UISwipeGestureRecognizer *swipe2 = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeToggle:)]; swipe2.direction = UISwipeGestureRecognizerDirectionDown ; [self.view addGestureRecognizer:swipe2]; [swipe2 release]; } then your toggle: -(void)swipeToggle:(UISwipeGestureRecognizer *)sender { if ([[UIApplication sharedApplication] statusBarOrientation] == UIInterfaceOrientationL

Categories : IOS



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.