why is there a margin introduced at the top as I move from iPhone startup image to same image as background on UIView? - iphone

why is there a margin introduced as I move from iPhone startup image to same image as background on UIView?
So I have:
image used for background/startup on iPhone, it's size is: 320 x 480
after startup I have a UIView that displays the same image (idea is not to have any difference the user can see when transisiton from start up image to the UIView background image)
the first view is "inside" a UINavigationController, however I set the MenuBar and Toolbar to hidden
There is however blank grey margin introduced at the top of the screen, between the signal strength bar and the top of the background image? The height of this grey margin I wasn't expecting looks to be about the height of the top signal strength bar. So this margin/bar effectively drops the background image downwards...
How can I remove this?
Before (i.e. iPhone startup image):
After (background image of first view):

Your launch image contains an imitation of the status bar. The launch image takes up the whole 320x480, but the background image is placed at the top of the main view which is below the status bar. So you can see the imitation status bar still.
Just decrease the y of the background image view to -20.

found two things required to fix it:
setting the View Mode to "bottom" and
found the imageview was slightly off positioned within the XIB designer itself

Related

Can't figure out why background picture doesn't fill all screen

I can't figure out why background picture doesn't fill all screen. There some fields around where superview could be seen.
Maybe there is something with that it is presented modally via segue?
This is what I get
And this is what I want to achieve. Note that superview background fills all screen width:
There is the problem in pixels of your image , preview your image and go to adjust size then give perfect height and weight as per your background view and use it

Keep autolayout view same size in 3.5" and 4"

I have a tracker that is 320 pixels tall that goes in the center(ish) of the screen of my app and I want to place labels in the four corners of the tracker, so I made an invisible view the size of the tracker so that I could align the labels to the view's edges, but autolayout keeps resizing the view when the tracker remains 320 pixels. Is there a way to keep my view the same size (390px) on both 3.5" and 4" iPhone screens?
You can always add fixed width and height constraints to your view. Select your view and then chose Pin/Width and/or Pin/Height from the editor menu. The pin menu is also available from the middle segment in that control thingy in the lower left corner of Interface Builder.
To keep your layout from being ambiguous you then might have to remove some constraints from the size inspector of the utility area.

How to get an image taken from the camera to take up the entire screen

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.

Interface Builder Off Vertically

I'm using Xcode 4.0 and when building my view in Interface Builder everything looks great. When I run my app with the simulator or iOS device the whole view is off vertically (showing a white bar at bottom). It looks to be off by 20 pixels. TabBar, Labels, Tableview, Text and background image are all shifted up. Any ides? Thanks
Are you running fullscreen? I'm guessing that you've set the Status Bar to 'None' which means the size of your view in the Interface Builder is wrong.
In your *ViewController.xib when you set the Status Bar to 'None' it sets the height of the view to be 460, when it should be 480.

Flip Animation is not consistant in size between front and back images

using the same flip animation as in the Elements, I have a view controller flipping two .png files of the same size (640 x 960) Within each image I have drawn a border and have noticed that when I flip the image, the second image gets stretched slightly downward and you no longer see the bottom border.
I've checked my .xib file where I have two views and an imageview inside each view. The imageviews are both the same size and have the same settings. I did notice that in interface builder the size for the layout is 320 X 460. Note that the first view appears in its entirety and as I flip it over and over it continues to appear as it should and the other image is clipped.
It turns out that the first view presented to the window has a heeight of 416 and not 480 as expected. I forgot to account for the added NavBar and the initial view squashed my image to fit in its entirety. I have since set the view size in the back view and am dealing with the smaller image area.