Detect Touch event in UIWebView - uiwebview

I want to finish such a demand, in the interface embedded UIWebView control, when the user clicks on a blank area and the area that link, jump to different new interface, but I can't distinguish between the two. Could someone help me?
I try put an transparent NSView over an UIWebView, and overide the touchesDidBegin etc, then send them to your webview. Ex: But the UIWebView can't accept touch events。

Related

How Can I Make a UIButton With No Animation Effects?

I know the title may be misleading so I'm going to explain what I want to do here.
I have a UIButton, a HUGE UIButton, set right after my application's background image. I configured the button to show this image with a background image I set. When the user taps the button, it gets a huge gray shadow and I really don't want that. So how can I make a button that will maintain it's state no matter what the user tries to do with it? I really don't want it to change at all when the user interacts with it. In fact, I wanted to use an UIImageView instead just to avoid the button animation. Since I couldn't get taps out of the UIImageView, I decided to use a button, but no matter what I touch in IB, the button keeps getting that gray shadow, and I have configured the Selected State and other states to be exactly as my default state.
Figured it out.
glassBackground.adjustsImageWhenHighlighted = NO;
Ideally, I would have loved to do that with IB but I'm happy with this result.

Dismiss spinner control popup if you don't want an item in android

I have an android spinner which I call via the performClick method to show a list of items (the actual control is hidden from the user and is called from a checkbox, too complex to explain why I have done it this way).
If I do not want an item in the list, how can I dismiss the popup by clicking on the black area?
Does this make sense? :/
Edit: Sorry, forgot to mention that the users will not be able to operate the bottom buttons (device is going to be galaxy tab) as they will be covered up with protective layer due as they will be outdoors.
usually such a control is dismissed using the back key in the android applications. So I would suggest that you find a way to do it the same way on your control.
'Esc' button should do the same job..

inputAccessoryView not hide the view when -resignFirstResponder?

I have attached a toolbar with a UITextField and UIButton to the keyboard when it becomes the first responder via the user taping inside the textfield
textField.inputAccessoryView = theToolbar;
Problem is, the toolbar disappears when the keyboard is dismissed, thus preventing any further input.
Any ideas on how to make the toolbar go back to the bottom of the screen rather than off it completely?
I'm thinking a delegate method might help but Im really not too sure. It seems once the inputAccessoryView always the inputAccessoryView :(
Cheers
The input accessory view is automatically dismissed with the input view (the keyboard, in this case). Generally you do not want to have an input accessory view in your view hierarchy. Instead, if you want your toolbar to scroll up when the keyboard is shown, you should follow the guidelines for Managing the Keyboard.
You could try using an additional toolbar that is offscreen as the inputAccessoryView, which could "fake" the appearance of what you are trying to do. Alternatively, have you tried adding the toolbar back to the bottom of the screen using
[self.view addSubview:theToolbar];
when the keyboard reaches the bottom of the screen? You can use keyboard notifications for this.

Capturing Gestures over a UIWebView

I am trying to set up a simple iPad application that has a table view and when you select a row for that table it displays a (drilled down to) UIWebView displaying the selected web page (related to the row selected).
Once in the drilled-down-to view I want to capture EVERY touch and gesture (tap, swipe, pinch, etc) and do my own thing with them. Yes, I know this will make navigating and interacting with the web page displayed impossible, that's the idea.
I have found and played around with the Stack Overflow question that was answered by this wepage: http://mithin.in/2009/08/26/detecting-taps-and-events-on-uiwebview-the-right-way/ and I can't get gestures to work with idea.
Any suggestions would be greatly appreciated. Thanks!
UIWebView already has a lot of gestureRecognizer attached to them. It might be a good idea to remove all those gesture recognizer before adding yours, as a testing unit.
If your gesture recognizer works, that means you could basically store the default recognizer in a private array and as soon as you want to give normal behavior to your webview again, you "reset" the UIWebView recognizer

UIWebView example code for in-app browser?

Anyone have some sample code for an in-app browser that they would like to share?
I am looking to add a browser view in my app that is pushed and includes a toolbar with four buttons: back, forward, stop/refresh and actions. However, I'd like to show somewhat transparent and none-tapable buttons when you can't go forward or back, and also have the stop/refresh button show the appropriate icon when it's loading and done loading?
My issue is currently that I cannot get "blanked out" back and forward that cannot be tapped if you cannot go back in the web history. Also, how do I change out the stop icon with the refreshing icon when the view is loading?
For tool bar items, simply set "item.enabled = webview.canGoForward;" (or canGoBack). To change the refresh/stop button you can set item.customView if you want to use a progress view or some such, otherwise if you just want to use a static image you can set item.image. All this is in the documentation as well.

Resources