landscape-portrait

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

Possibility Portrait mode in 1 UIView

安稳与你 提交于 2019-12-11 18:16:07
问题 Is there a possibility that I can programatically say that only 1 UIView can be in landscape mode? My Whole app has to be in portrait mode (not moving at all) but 1 UIView should be able to go in Landscape mode (To show pictures even better); 回答1: You rotate VC like this: - (BOOL)shouldAutorotate { return self.topViewController.shouldAutorotate; } - (NSUInteger)supportedInterfaceOrientations { return self.topViewController.supportedInterfaceOrientations; } Restrict VC so it won't rotate: -

LandScape/Portrait size differ iOS

China☆狼群 提交于 2019-12-11 18:11:51
问题 I have five UIButton and I need to set the frame of the UIButton in such a way that it should be for the Landscape and portrait different size. but the from the Below code viewDidLoad its loading fine but problem is that After loading the stack When I move to the Landscape to portrait or the portrait to Landscape it should be change according to the viewdidload size which i have set ..but this is not happening...its been overlapping as previous Button is already created....what changes do i

Xcode - Lock all views in portrait except one view using XIB

风流意气都作罢 提交于 2019-12-11 12:54:10
问题 i need some help. I'm currently doing an application in xcode where i need to have all views locked in portrait mode, but i have a second view controller that needs to go in landscape because i'm using mediaplayer framework to show a video and that needs to be in landscape. I have been searching for this, for around a week now and still can't solve the problem. I'd appreciate the help thanks in advance. 回答1: This has two aspects. 1. How to lock the orientation for each view controller as

The child view does not rotate from landscape to portrait and vice versa

社会主义新天地 提交于 2019-12-11 05:02:46
问题 I'm making an application for the iPad. I have a view controll that has to stay in landscape, this works just fine. - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation { return UIInterfaceOrientationIsLandscape(toInterfaceOrientation); } From this view i push towards an other view, this child view should rotate to the appropriate rotation (landscape or portrait) whenever the user tilts his ipad. in this child view i use this code to make this happen,

iOS 7 - Display a View as Portrait Only for application built in Xamarin

瘦欲@ 提交于 2019-12-11 02:44:08
问题 I am developing an application for iOS in Xamarin, I have a login screen as my first view which I want to display as portrait only and the rest can do landscape or whatever. As this is in C# these are the methods I have overridden in my ViewController but the view still rotates on my iPhone public override UIInterfaceOrientationMask GetSupportedInterfaceOrientations () { return UIInterfaceOrientationMask.Portrait; } public override bool ShouldAutorotate () { return false; } I am probably

How to determine if a device is in portrait or landscape mode using CSS

こ雲淡風輕ζ 提交于 2019-12-10 20:57:28
问题 For determining screen size I'm using media queries but I want determine if a device is in portrait or landscape mode using CSS so that I can have different background image as per screen size. Any thoughts? 回答1: simply write media queries for landscape and portrait modes: /* Portrait */ @media screen and (orientation:portrait) { /* Portrait styles */ } /* Landscape */ @media screen and (orientation:landscape) { /* Landscape styles */ } link here 来源: https://stackoverflow.com/questions

iOS portrait only app returns from UIWebview youtube in landscape

孤街浪徒 提交于 2019-12-10 14:24:57
问题 I'm creating an iOS application and i've encountered the following problem: The project is set to be a portrait mode application. I have a UIWebview , which loads a webpage with a youtube video in it. When the video is clicked it starts in the youtube player . When the video changes to landscape mode and 'done' is clicked it returns to the UIWebview showing it in landscape . I do receive a NSNotification when the video is finished but I'm not able to force portrait mode. This should not be

Handling multiple tabs during landscape and portrait in android

徘徊边缘 提交于 2019-12-10 09:47:07
问题 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. 回答1: You can use onRetainNonConfigurationInstance() to solve this issue. public void onCreate(Bundle savedInstanceState) { .... lastTab = (Integer) getLastNonConfigurationInstance(); ..... if(lastTab !

Combine layout_weight and maxWidth for views

允我心安 提交于 2019-12-10 02:22:35
问题 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?