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.
Related
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.
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 lazy load UIWebViews inside a UIScrollView.
Every time the user scrolls, the WebViews frames are updated and new content SHOULD be loaded. And that's exactly where I'm having trouble. The repositioning works well, but the new content (local NSStrings, which are called using loadHTMLString) does not appear until I stop scrolling the ScrollView.
I've read this thread already: NSURLRequest won't fire while UIScrollView is scrolling.
Getting some inspiration from that, is there any association I could make between loadHTMLString and NSURLConnection? I know next to nothing about NSURLConnection.
If that's not possible, is there any other solution? Either halting the scroll for a while (like MobileRSS – an App Store app – does) or alternate loading methods?
Edit: My UIScrollView has paging enabled. So if I were to halt the scroll for a while, it should happen at every page. But I still don't know how to accomplish that.
Old question, but here is an answer for it.
You'll have to subclass the UIWebView and switch the run loops started at a overridden loadHTMLString:baseURL:
and switching it back after the html has been loaded (or failed to load).
Check out this project on github which gives you an example of where to override in all the right places.
Can I develop an application on web to draw something on iPhone? I guess not because when I draw in the browser it will be treated as "dragging" but I just want to double check for a solution out there.
Thanks.
Marcelo
I presume you mean to ask if is possible to draw into a UIWebView?
I don't think so. In UIWebView the page display view is embedded in a scroll view and scroll views trap all touches to determine if they can scroll. It's pretty much configured as read only.
You could in theory put a transparent view over the web view to trap the touches then send those to the the actual browser view. I haven't done it but it might possible.
I'm trying to create a modal status indicator display for an iPhone app, and would like one similar to this one used in Tweetie:
Specifically, this one "shades out" the entire screen, including the toolbar. I don't believe through any normal UIView manipulation, I can extend past the bounds of my window, can I? I believe I've seen a status indicator like this somewhere else on iPhone, possibly when I added an Exchange e-mail account.
I've tried subclassing UIAlertView and overriding its drawRect method. If I don't call [super drawRect:] it doesn't ever display the normal UIAlertView text box, however my drawing rectangle is in an odd size and position.
Anyone have any advice to accomplish this?
Check out MBProgressHUD.
Take a look at the source code to the WordPress application. They have code which you can basically drag and drop into your application to do this.
http://iphone.wordpress.org/development/
I haven't done this myself, but you could layer a UIView at the top of the view hierarchy, and use setHidden to dynamically show or hide it. Since it's at the top of the stack, it should be able to intercept all touch events.