UIWebView won't scroll till the end / bottom - iphone

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!

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

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 ;

UIActivityIndicatorView Misaligned

I have UIActivityIndicatorView centered horizontally in a XIB.
In iOS 4 (Simulator), the indicator defaults to Large White (the color property being introduced in iOS 5), which is fine. The weird part is that it is also offset.
My initial assumption was that something was wrong with the XIB (or something to that effect). However, in iOS 5 (Simulator, iPhone 4), it works perfectly.
Seeing as how the only thing changed from iOS 4 to iOS 5 regarding UIActivityIndicatorViews was the addition of the color property, I'm stumped. I'm aware that there's probably nowhere near enough information here to deduce the exact problem. I'm more concerned about where to start debugging, and welcome any suggestions as to what further information I could supply.
Further Information:
The iPad loads the indicator in a reliable position, only changing colors between iOS 4 and iOS 5.
I have two static origin points (portPoint = (x, y); landPoint = (w, z);), that I manually set on rotation. When the app loads, the indicator's origin is (correctly) portPoint (which I've verified via NSLog), despite being visually misaligned. When I rotate to landscape, the origin correctly (visually and data-wise) sets to landPoint. When I rotate back, the origin correctly (visually and data-wise) sets to portPoint, thus resolving the issue.
You're right that w/o seeing your code I can't tell if anything else is going on but centering a view within a superview and maintaining that when the device rotates is fairly simple. Try this:
Make sure the autoResizingMask of the UIActivityIndicatorView is set to UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin
Position the activity indicator in the center of its superview, either in the XIB file or in viewDidLoad
Don't change the frame of the activity indicator on rotation, it should stay centered automatically
If the above doesn't fix it, post some code along with the autoResizingMask and contentMode values for relevant views.
It sure looks like its positioned as if the device were in landscape. Check to see that you reposition it properly when the view size or orientation changes.
Ideas:
1/ Your view (activity indicator superview) is bigger than your display (bad autoresizing mask? bad values in xib plist?) or it has bad position inside its superview.
2/ Autoresizing masks are not set correctly. For the activity indicator it should be
(UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin)
To debug this, try to put logging into viewDidAppear. Get the center (CGPoint) of your activity indicator and use UIView methods to convert it to your top view coordinates (e.g. [UIView convertPoint:fromView:]). This position should be the same as the one you see on the screen.
If it's not, there is some bigger problem, possibly connected with animation states.
Otherwise you should be able to find the view which translates your activity indicator to this weird position. Log the frames of all views in your hierarchy.
Check that you log the information at the right place and you don't change view positions after the logging.

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.