Currently the way ios handles input fields in the uiwebviews is by pushing the uiwebview up when u tap on the input field in a uiwebview. Sometimes, the uiwebview goes outside the page. I was wondering how the whole things work? My parentviewcontroller doesn't have any scrollview inside etc.. but yet it pushes the uiwebview up.
Any idea how I can prevent the keyboard from pushing the uiwebview up. How does it know by how much it needs to push up. I added a method to get the information about the keybaord when it shows up and the size of the keyboard which is returned is 1024px for the height which is really weird.
Thanks.
Related
I have a UIViewController with a UIScrollView inside it. This scroll view contains a few strings and images, and more recently it's own UIWebView which contains a YouTube video.
As a first case, assuming the user has Internet access, how should I show the user that the box contains content that is currently loading?
Musings:
I was able to place a UIView on top of this UIWebView (within the scroll view) which contained a UILabel with the text "Loading..." inside it. But I was unable to remove/hide the label based on when the video has fully appeared as I could not get viewDidAppear et al to respond. I also have access to a BOOL which tells me if the user has Internet access or not, so the other side to the question would be to set the same label to explain that they have no web access if that is true. (which would explain the presence of a white box in this scroll view)
I also looked at whether it'd be possible to write a custom responder to fire off when the video thumbnail in the web view had finished loading, but again I couldn't get any of the responder methods to be hit for this to work.
In short, how should I be tackling this problem? Thanks in advance for any advice or assistance.
Set your view controller as the web view's delegate. The UIWebViewDelegate protocol defines two methods, -webViewDidStartLoad: and -webViewDidFinishLoad:, that you should be able to use to track when the page has begun to load and (hopefully) when the thumbnail has appeared.
I am using nine webviews inside a scrollview to get an infinte scrolling effect. I am loading image map inside each webviews. Now the problem is webviews are not responding sometimes for the touches, when it is a hard-touch(touch and hold). I am getting this issue when more than one webviews are visible. I have set the delegate for every webviews, I dont know why this happening.
I am loosing the selection while holding it, its grey color dissappears. This issue I am getting only in 3.2iPad device.
I need to get the shouldStartLoadWithRequest method called while each press. what i need to do?
thanks in advance,
You have to read the Apple document for UIWebview, they are clearly saying,"Important: You should not embed UIWebView or UITableView objects in UIScrollView objects. If you do so, unexpected behavior can result because touch events for the two objects can be mixed up and wrongly handled."
check this link:- http://developer.apple.com/library/ios/#documentation/uikit/reference/UIWebView_Class/Reference/Reference.html
But I also do adding UIWebview to UIScrollview, But in my case the frame of a webview is same as the frame of scrollview. In this case the touchevent is properly detected.
And One issue I found in this case we can get UITapGestureRecognizer from that Uiwebviews...
I'm trying to pop up a UIWebView on iPad with a web site that is specifically sized for the iPhone (320x480). I want the web view to be centered, and transition in using a zooming animation. Other apps have this functionality, but I can't seem to find out how to do it. I've tried various combinations of presentation & transition style, but no matter what I do, the web view takes up the entire screen and slides vertically to cover the screen. I've made the web view 320x480 in IB, and am using UIModalPresentationStyleFormSheet, which should make it at least slide up into the center of the screen using a small window, but that is not occurring.
anyone know what's wrong?
Are you setting the property of the parent UIViewController or the modal UIViewController? Because you should be setting the properties of the modal UIViewController before presenting the controller instead of the parent.
This might be no help at all because you're doing the right thing, but it was the first error I made when starting to use MVCs.
maybe any of the autosize property is set. just do one thing bind your webview with the code and through code try to set the frame. Hope it will work as it worked many times to me when i faced similar types of problem.
hAPPY cODING...
I am trying to have a UI which is a full screen UIWebView. When the view is touched the tool bar appears.
I can do everything but get the touchend event in the UIWebView. I have tried putting a UIColor.Clear'd UIView ontop and catching TouchEnd there and passing it on, but would like a better solution.
I understand that we are not supposed to subclass the UIWebView from the docs.
Ideas?
I found a better solution. Simple have the HTML in the UIWebView send a message to the client via a document.location = "SomeCommandName"
Then catch this in code and toggle the view as needed.
Much simpler.
I have a simple app with a full screen UIWebView. This contains HTML generated by the app. I respond to clicks on various elements of the page via document.location = "someCommand"
I have to touch the screen once before it will respond to a second touch. It's almost like it is not the focused control.
It is the only view in the app.
How can I ensure that the first time the UIWebView is touched it responds?
I think you should simply set it as the firstResponder when your view controller is put on the screen.