Re-size the TabelView in iphone 5 - iphone

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

Related

iphone 5 showing white strip at bottom

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 ;

UIPickerView as inputView gets messed up on orientation change

I'm using a standard UIPicker view as an inputView for a textField in an iPhone application. When the view is loaded in either landscape or portrait, the picker is sized the same as the appropriate keyboard. However, when you rotate the device once inside the view the picker doesn't resize it's height properly, like it does with it's width. I have UIViewAutoresizingFlexibleWidth set. When I tried setting UIViewAutoresizingFlexibleHeight as well the picker gets messed up (choppy graphics, component cuts off) on rotation, though the height is correct! Has anyone figured this out?
I found that if you are working with iOS 7 simply add:
pickerView.autoresizingMask = UIViewAutoresizingFlexibleHeight;
This solved the problem for me. The transition isn't very choppy, looks like it "should" look.
I found a band-aid:
In didRotateFromInterfaceOrientation: in your hosting viewController, call setNeedsLayout on that picker view. The weird layout glitches are visible during the rotate but clean up at the end.

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.

UIWebView won't scroll till the end / bottom

I have the same problem as described here: UIWebView doesn't scroll to the bottom of the webpage loaded/created (unfortunately nobody answered there)
I have a UIWebView with inside UIView, and it doesn't scroll to the bottom, it's actually possible to scroll it but it is bouncing back again, so I can't see about bottom 100 px of my WebView, what can it be?
Thank you
Sorry guys, was my fault, I just had to reduce the height of the WebView
I got this problem today. I had set the constraints wrt iPhone 4 inch screen.
So when I executed the app on iPhone 3.5 inch screen, it didn't show the bottom part.
The solution was to go to the Interface Builder and click the button to go to 3.5 inch form factor. (the one which alternates between 3.5 and 4 inch form factor).
Then select 'Webview'.
Editor > Resolve Autolayout Issues > Add missing constraints
This solution is for Xcode 5.
If you can't scroll to the bottom end properly using UIWebView:
1) One way (Programmatically) to solve the problem is using proper autosizing to UIWebView.
self.webView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin ;
2) Other way (Interface Builder) to solve the problem is using proper autosizing to UIWebView. Go to Interface Builder->Web View->Size Inspector and tick autosizing parts in all places (As seen on Image above)
Don't forget to disable Autolayout for the web view!

IPhone how to properly resize view when rotating device

I have been trying to resize my view inside a view Controller with no luck so far. Basically I have a button at the very bottom of my view and when the orientation changes from Portrait to Landscape the button is no longer visible, because its just too far down now.
How can I resize this view so that when the orientation changes the button is still visible?. I have tried setting
self.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
and basically every other possible combination, with no luck so far. I know I can do this by manually repositioning the button, but is there a better way to do this?.
Thank you.
-Oscar
The view containing the button must be auto-resized using your mask (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight).
On the containing view autoresizesSubviews must be set to YES.
The button must use UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleTopMargin.