Resizing view to display over hidden uitabbar in iPhone - iphone

I have an uitabbarcontroller which contains a couple uiViewControllers.
When i show one of those controllers i am hiding the tabbar. This view has a fullscreen uiimageView. The thing is i am seeing a white rectangle over where the tabbar is hidden.
I have tried resizing the views but the white rectangle is still there. Any ideas? Thanks

Fullscreen in the tabbar or for the entire viewport of the device? The rectangle is there because one of your views is not positioned correctly.
Validate that your UITabBarController and/or UIViewController is set to the correct size and the correct position on the screen.

Related

How to autosize view without auto layout in iOS

I have a problem that I can't understand resizing views. My deployment target is iOS 5.0, so I have disabled auto layout in the interface builder to make it compatible with iOS 5.0. The view does not resize automatically. Following is an example:
Interface Builder Snapshot:
4-inch screen:
3.5-inch screen (has problem):
As you can see, the button at the bottom of the view goes out of the screen. The background image also does not resize automatically. I can not understand how I can solve this problem. Can anyone help me?
Welcome to the pre-autolayout world! You must set the autoresizing "springs and struts" so that the stuff at the bottom is attached to the bottom of the superview and not the top. So, struts to the bottom, springs to the top. That way, as the superview gets larger and smaller, the stuff at the bottom moves with the bottom.
You could alternatively reposition the stuff in code, but there's no need in this situation.
Here's the section on autoresizing from my book:
http://www.apeth.com/iOSBook/ch14.html#_autoresizing
The part about the superview and the background image not being resized is a different matter. Is this the view of a UIViewController? If so, then if you are putting the UIViewController into the view controller parent-child hierarchy correctly, it will be resized by its parent. But you have not shown any code, so there's no telling what this view may be or how it is supposed to get into the interface.

When on iPhone 5 landscape mode, the button on the right of navigation bar stops working, how to fix it?

When updating my old program for iPhone 5's 4 inch screen, I found that the navigation controller keeps to its original 3.5 inch screen size and refuse to stretch to fit the 4 inch screen even when its view controller's view and tableview controller's view are all stretch to fit the 4 inch screen. Because the navigation controller's view is not visible during normal use, people may miss it. Because it refuses to fit the new 4 inch screen, when in landscape mode, the screen go beyond the navigation controller's view width and the right button fall off the boundary and becomes unresponsive. In order to show the situation above, I set the navigation controller's view's background color to semi-transparent red and the table view's background color to semi-transparent blue. as shown in the screen shoots below. The question is, how to fix the problem. the plus button are not responsive when in landscape mode, but in portrait mode, it works fine.
Either your navigation controller’s view or, more likely, the window that contains it, are not getting set up with the correct frame. If you’re creating the window in code, make sure you’re using UIScreen -applicationFrame or -bounds rather than a hardcoded (320, 460) or (320, 480); if you’re using a NIB, check your autoresizing masks and layout settings.

White space after moving uitabbar to the top

I use UINavigationcontroller inside UITabBarController and I have moved the UITabBar to the top .The UITabBar has moved successfully but the problem is, there is about 50px of white space where the tab bar used to be .
Anyone has a solution to this problem????
loop through the subviews of the tabbarcontroller.view until you find the container for the tabbar's inner views, then set the frame of that view to 50px higher than it currently is.
Alternatively, a better solution is not to try and use a tabbarcontroller this way. Just use a standalone UITabBar and implement your own view swapping logic when the tabs are tapped.
Uncheck extended edges in rectangle.

Iphone View Rotation not functioning properly

I have a simple 1 screen app, with 1 View.. the view contains
a button, an textbox and a button across the top
A segmented controller across the bottom
and a MapView in between.
In portrait mode all is right with the world.. So I decided to begin to allow Orientation change...
in IB all views and elements and even the root window have autoResizeSubviews set
in My AppDelegate and my viewController I have also programatically added SetAutoResizeSubviews to yes explicitely I have set the autoResizingMask in the Root Window and the View Controller to FlexibleWidht | Flexibile Height
I have added the shouldAutorotateToInterfaceOrientation in my ViewController to always return true.
Yet, it doesn't work.. Or should I say it doesn't rotate properly.. in both portrait modes everything looks great, but both landscape modes, things don't get laid out or resized properly.. Basically all I see is the mapview, and its size gets slightly wider, but not much than the portrait mode, and it doesn't fill up the screen top to bottom.. all other interface elements with the exception of one button are invisible and it appears on TOP of the mapview.. as thought it just happened to be layed out over the view by coincidence than any design.
Anyone have any ideas what I am missing, or why?
Thanks in advance
You say "I have set the autoResizingMask in the Root Window and the View Controller" but that is a red herring. It is the buttons, the text box, the segmented controller, and the map view that have to have the correct autoresizingMask. If this view is being designed in the nib, you can set the values there and then turn the orientation right there in the nib and see what happens.
If you are unable to work out good autoresizingMask values for all those interface elements, implement didRotateFromInterfaceOrientation and perform the layout alterations in code when called upon to do so.

Using translucent UINavigationBars

I am using InterfaceBuilder to set up my app. I have several views being controlled by a UINavigationController. In IB I set up the views using the simulated metrics to position the elements below the Navigation Bar.
I have a background texture that is placed in the window object of the Main.nib so that it is shared throughout the app. I want that texture to be visible behind a transucent navigation bar.
If the actual navigationBar's style is BlackOpaque the elements of the various views are positioned correctly below the navBar when the app is run.
If I set the NavigationBar to be translucent, view elements are repositioned to the bottom of the status bar when the app is run so that they are visible behind the navigationBar, even though they are positioned correctly in their various nib files.
How do I defeat this behavior?
I figured out the answer...
If you do NOT want objects to be slid up to be positioned behind a translucent NavigationBar, In IB, set the simulated metrics for the navBar to none, and position the view elements as desired.