iphone 5 showing white strip at bottom - iphone

My app works fine in iphone 4 but my iphone 5 showing this below white strip. I have added
Default-568h.png too but issue is still there. What should I do?

It looks like you need to set the resizing masks for the view. Make sure it's set to stretch by height in the Autosizing section of the size inspector in Interface builder. Or set the masks appropriately in code if you're not using interface builder.
Edit---
In Code:
see autoResizingMask:
http://developer.apple.com/library/ios/#documentation/uikit/reference/uiview_class/uiview/uiview.html
Interface builder:
The Autosizing section is what you want.
Make sure the masks are set like this for the view. You will also want to set the outer bars for any controls. Clicking the bottom bar will tell the button to stick to the bottom of the view for instance.

try this one :
yourView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleTopMargin ;

Related

Re-size the TabelView in iphone 5

I'm using the Autosizing mask for UITableView so it is working fine with iPhone 5 as well, but I'm doing some frame animation in that controller so the UITableView automatically reduces its height.
Not able to understand What is going wrong. I did the autosizing mask programmatically also but doesn't works. I'm stuck here...!
Lots of thanks.
you should not use UIViewAutoresizingFlexibleBottomMargin in autoresizing mask if there is Tab bar bottom toolbar at bottom of the table.
Try this code..
self.tblRoomList.autoresizesSubviews = YES;
self.tblRoomList.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleLeftMargin|UIViewAutoresizingFlexibleTopMargin|UIViewAutoresizingFlexibleRightMargin|UIViewAutoresizingFlexibleBottomMargin;
Or do like this

How to anchor buttons to bottom of view when rotated?

I have a view on an iPad that contains one UIWebView consuming most of the display and two buttons at the bottom. When I rotate left, the buttons end up on the right and I have a gap on the left not filled by the uiwebview.
What I would like is for the buttons to always be on the bottom and for the uiwebview to fill the remaining space. I have tried various options with autosizing in interface builder without success.
Is this possible with autosizing? It seems like a fairly simple scenario.
Set the button's autoresizingMask to UIViewAutoresizingFlexibleTopMargin and the web view's to UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight.

Auto Resizing with Interface Builder and Code?

I want to use auto resizing mask in iPhone to adjust view in landscape and portrait mode. The problem is when I apply width spring from Interface builder, the button changes its size proportionally. But when I apply the same spring by code i.e.
[self.view setAutoresizesSubviews:YES];
[testButton setAutoresizingMask:UIViewAutoresizingNone];
[testButton setAutoresizingMask:UIViewAutoresizingFlexibleWidth];
the button doesn't show the same behavior.
Auto resizing applied on button from Interface builder:
original button size: 120 width and 37 height
landscape mode button: changes size proportionally
Auto resizing applied on button from Code:
original button size: 120 width and 37 height
landscape mode button: changes size by keeping same left and right margins in both Portrait and landscape mode.
The mask applied from code doesn't seem to work correctly as the size of button created from code comes out to be greater.
My views are complex that is why i don't want to set the frames of each subview on the View.
Anyone with same issue!!!
Thnx for responding guys, by the way I have solved my issue. There was nothing to do with the link with the interface builder. Actually while creating your view without interface builder, if you want the subviews to be auto re-sized; You have to set springs and struts in a single line using the bitwise OR connector. The code I used for re-sizing my view is:
[appLogo setAutoresizingMask: UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleLeftMargin];
Check 2 things.
1. Connection of IBOutlet
2. Also check that you have created the #property of the IBOutlet of view you have created.
Hope this solve the issue.

Button disappears when iPhone rotates

In my application, I have a series of tables which leads up to an image. In portrait mode, there is a button in the bottom right hand corner, and when I select this the screen flips and I can make notes.
When I turn iPhone to landscape mode, this button disappears completely.
Any ideas?
If you're setting up the view in code, use the autoresizingMask property. This is what is being set by the constraints in Interface Builder. However, it's a little backwards from what you see in Interface Builder. If you want it to stick to the lower-right corner, set view.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleTopMargin (which is equivalent to enabling the springs on the right and bottom in IB. Flexible width and height, on the other hand, work as you would expect.
As long as the superview has autoresizesSubviews set to YES (the default), it will reposition automatically when you rotate.
That's probably because the button is just off screen. You need to constrain it in Interface Builder (on the size/layout tab of the Inspector Window) or use setFrame: to reposition it when the app rotates and then again when it rotates back.
Anytime the device rotates, it will reposition items based on either code or how it is constrained in Interface Builder. If you don't control the repositioning, then it might give the appearance that it magically disappeared.

Tab views on iPad not resizing

My view doesn't stretch to fit the current orientation!
I am creating a tab bar application. I replicated the sample one that you create when you "create a new tab bar application". Everything works except when I change the orientation of the iPad it rotates the view, the tab bar stretches out on the bottom, but the view doesn't resize. Basically if you start in landscape then rotate to portrait, it rotates but the view is still landscape shape even though it rotates.
My tab bar has two tabs (just like the sample application) and so I compared mine against the sample which works property by property. One difference is I noticed my FirstView in IB under the resizing area doesn't show the resize arrows left/right up/down. In other words it isn't marked to auto fill its container. The sample's FirstView and SecondView DO have these arrows. But I can't turn them on!
I even tried creating a fresh new view but I still can't press these arrows on. what am I doing wrong here?'
Thanks a lot.
The solution is this:
self.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
Do this in viewDidLoad. There must be a bug in IB.
Another answer is turning off any simulated tabbars, nav bars, or status bars on the view in Interface Builder. Go into the autosizing area and turn on the auto grow arrows. Then turn back on the simulated user elements.