My application support to display some screen in landscape mode, and in landscape mode, I set to hide the status bar to get mode space to display data.
The problem is while hiding the status bar and rotate screen, it leave a white pace at status bar position until the screen is rotated completely as below screenshot.
I guess that steps of operations when rotating screen are:
1. hide status bar
2. rotate screen
3. resize screen to take place of status bar.
So until the screen is rotated completely, user still can see the white space, it is not good and I want to do something such as: set color for that blank space to black, or set animation to hide that blank space but unlucky!
So, does anyone have solution to resolve this, please help me, thanks a lot!
you should make the size of view 320 * 480. as you might have hidden the statusbar but the size of view will be 320 * 460(default)
Check out this one.
Related
I have dragged a UIImageView onto the UIViewController window in storyboard. I used the handles to make it take up the entire window. I set the mode of the UIImageView to "Aspect Fit". My goal is for the picture to take up the entire window when the iPhone is held in the same orientation that the image was taken.
But for some reason there's a little bit of space above and below every image.
Also I have it set up for the navigation bar and status bar to disappear when the user touches the image by using a hidden UIButton. This works okay except that the image shifts down when the navigation and status bars come back into view. The image only shifts down when I have this code:
self.navigationController.navigationBarHidden = YES;
self.navigationController.navigationBarHidden = NO;
which I use to get the navigationBar to redraw itself below the statusbar because sometimes the navigationbar will be drawn underneath the statusbar (this happens when making the navigationbar and statusbar reappear at the same time.)
How can I make my images display full screen without all these quirks?
EDIT:
I think it may have something to do with this:
The camera's aspect ratio is 4:3 and the screen's aspect ratio is 3:2.
So there is simply no way for the camera picture to fill the screen
unless you're willing to crop is to 3:2. To do that, apply an
appropriate scale transform.
is it possible to apply an affinetransform to an image in a uiimageview?
You'll want to set wantsFullScreenLayout to YES on your instance of UIViewController. From the documentation for wantsFullScreenLayout.
When a view controller presents its view, it normally shrinks that
view so that its frame does not overlap the device’s status bar.
Setting this property to YES causes the view controller to size its
view so that it fills the entire screen, including the area under the
status bar. (Of course, for this to happen, the window hosting the
view controller must itself be sized to fill the entire screen,
including the area underneath the status bar.) You would typically set
this property to YES in cases where you have a translucent status bar
and want your view’s content to be visible behind that view.
If this property is YES, the view is not resized in a way that would
cause it to overlap a tab bar but is resized to overlap translucent
toolbars. Regardless of the value of this property, navigation
controllers always allow views to overlap translucent navigation bars.
I've got a button designed on Portrait Orientattion, when I switch to Landscape it doesn't appear, what should I do so that it stays all the time?
Make sure you set the proper AutoresizingMasks for your UIViews. For example, it might be that your button has a y-coordinate that is larger than the device's width and has a fixed top resizing mask, so if you turn the device to landscape mode it gets clipped. Doing this...
button.autoresizingMask = UIViewAutoresizingFlexibleTopMargin;
...will cause the button to shrink its top margin, moving on screen.
In your comment you mentioned that this is a split-view app, if your button is in the root view controller of the split view, you should probably add support for restoring the root view controller as a popover.
I have a window that is in landscape mode. I have shifted my statusbar in landscape mode but the area where my statusbar was is still left white. I need to remove my window so that the area is filled. Can anyone help?
If you're using Interface Builder, set the Status Bar attribute to None in your view (under Simulated Metrics in the Inspector), and it will stop believing it has a status bar. I don't know if this is the specific problem you're having without further information, but this has been the cause of white status bar areas for me in the past.
I'm working on an app and I want to make it full screen, but when I hide the status bar I get an offset of 44px (status bar size).
With status bar the buttons are on the line:
http://i55.tinypic.com/xlbjsz.png
Then I've set in the Info.plist file "Status bar is initially hidden: YES"and I get an offset: http://i55.tinypic.com/2up3ceo.png
And when I uncheck Autoresize subviews I get this:
http://i54.tinypic.com/2h821r4.png
I've put on all xibs status bar to none, including window.xib, I don't have any ideas left, please help me.
From the images you uploaded it seems everything works as it should. When you hide the status bar your view will shift up the amount of pixels that the status bar was previously using to display itself.
So if the views size is 320 x 460 when the status bar is shown (the status bar has a height of 20px so if you add that up it will make it 320 x 480 the full iPhone screen size) when you hide it your view will have a new size of 320 x 480.
As you said by default your view will autoresize the views inside and when you checked it out it's only normal to get a 20px gap at the bottom of the page.
Please keep in mind that on a retina display (iPhone 4) all these sizes are doubled, so you actually get a 40px gap at the bottom.
I don't understand what's wrong in my very simple application with device rotation :
I built my view with interface builder. (See screen capture here)
I specified <key>UIInterfaceOrientation</key><string>UIInterfaceOrientationLandscapeRight</string> in my info.plist file.
I had a (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {return YES;} in my root view controller.
The area on the left (shown in red on the capture), around 20 pixel width, keeps inactive (nothing append if I hit a button in this area). In fact the full screen is active only in portrait mode, in landscape right mode there is this 20 pixels width inactive area, in landscape left mode this inactive area is on the right, in portrait upside down mode this area is on the bottom.
I read lots of posts and documentation about UIView rotation, but I did not find anything to solve this problem (I tried to play with view.frame and view.bounds without any success).
Anybody has an idea ?
Thanks a lot.
Regards.
Sébastien.
One of your views is probably not autoresized correctly.
After rotation, it still has its old bounds of, for example, 320 x 460. Since views normally don't clip their contained views you don't see a difference.
Events on the other hand are only delivered to views that are contained in their superviews bounds.