I have a problem with my iOS application ...
This is what it looks like in portrait mode, pretty normal, nothing bad I could say.
This is what it looks like in landscape mode.
The view beneath the segmented control overgrows, covering the segmented control.
I tried to change the settings in the size inspector and the best thing I could do is this:
Still not what I wanted (now white stripe beneath the segmented control covers the view, and I still don't know where it came from).
I would really appreciate if someone could help me make the landscape view similar to the portrait one, regarding the segmented control - > view thing.
you will have to use autosizing ...
tutorial for autosizing can be found here :
http://www.edumobile.org/iphone/iphone-beginner-tutorials/how-to-use-autorotation-and-autosizing-in-iphone/
Related
I would like to know what is the best way to do what iPhone calculator does as far as switching view from portrait to landscape. To me it looks that the portrait UI is in a view that goes directly (with resizing) into a subview on the right side of the landscape view. And on the left side of the landscape subview there are more calculator buttons added. If this is a reasonable assumption of what is going on, I would like to know how to rotate the portrait xib file to become the right side of a subview in the landscape and furthermore add more stuff to the left side subview of landscape UI? Do I need a second xib file? Or do I rotate one xib file and add stuff in the code to the left subview?
Before going to tell you in detail, i think this answer may help you, if not feel free to give the comment.
I am coming onto a project that only looks good in landscape view. When I switch to portrait, it looks like all the elements stay where they are and things do not get resized to fit the view. Some of the content on certain pages might not fit in portrait mode at all based on how things are already laid out in landscape.
If I want to make the app look good in both orientations, is my best bet to play around with the resizing on the size inspector for views that items will fit fine.
And then for views where items do not fit easily, rethink the design and either use some iPad functionality like popover, or create a separate view to display the data differently instead of just resizing?
Thanks.
Quite a bit can be achieved by playing with resizing controls in IB (especially the ones that stick the control to a side - sometimes it may be not very obvious, like "stiking"the control that's on top to the bottom side).
However, a much more robust solution is to have a method that would reposition/resize all your controls depending on the screen size (1024x768 or 768x1024). Then call it whenever the device is rotated.
Such a method is also quite handy for other purposes - e.g. if you have a view that is only sometimes visible (like an ad), you'll need to resize the rest to a non-full-screen size.
I am writing a game in the landscape mode. In *.plist I've set the "Initial interface orientation" option to "Landscape (left home button)". In Interface Builder my form seems good, with 2 labels are on the left and bottom.
But when I launch the app in simulator or in iphone that looks like the following
http://www.glowfoto.com/static_image/07-102041L/8907/png/09/2010/img4/glowfoto
Labels are on the top and rotated. Anyone knows what I am doing wrong and how to solve this?
I think your view controller's shouldAutorotateToOrientation method is not returning YES to landscape but to portrait orientations. But without code it's a guess in the wild.
I'm trying to make an app that handles orientation/rotation similarly to the way the built-in Calc app does.
If you check out that app, in portrait mode there's a normal calculator, and if you rotate to landscape mode there are additional buttons that appear to the left.
I can't figure out how to do this by setting the autosize masks. The problem is the "normal" calculator view is 320px wide in portrait mode, but actually shrinks to around 240px in landscape mode to fit the additional controls.
I've seen examples like the AlternateViews sample app that have two different view controllers (one for portrait and one for landscape), but they don't seem to animate the transitions between the views nicely like the Calc app does.
I've also tried setting the frames for the views manually in willAnimateSecondHalfOfRotationFromInterfaceOrientation, but it doesn't seem to look "quite right" and also I'm not certain how that works with the autoresize mask.
Any ideas how this is done? Thanks!
Just override the following method call:
- (void)willRotateToInterfaceOrientation: (UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
Inside of there resize all of your components so they look nice.
I want to design an application by using Interface Builder, in Landscape mode. I don't know how to put the controls suitable to the Landscape mode. All I know I m rotating my UIView by using self.transform. I am new in it. So can anyone help me.
Not sure if this is answering your question but you can rotate the views in IB to show in landscape mode by click on the arrow in the top right corner
See the image
IB landscape
I realize this is a bit old, but in Xcode4+ I can't see any rotation arrows. So instead, open your .xib > go to Simulated Metrics > Orientation > Landscape. Like this:
If you can't see the Simulated Metrics option, make sure your view is selected in the object hierarchy:
Short answer is (as far as I know) that there is no easy way to do it currently:
What's the best way to handle landscape/portrait differences in IB?