I see the Manipulation events for a WebView control, but I notice that do not seem to fire. Is it possible to handle Manipulation events for a WebView control?
I have ManipulationMode="All"
No, they are not. Not as part of the WebView control at least. It has to be done in the JavaScript of the page where InvokeScript may be a solution. But that's tricky too.
Refer to : How to handle a JS event with InvokeScript in a WebView
Related
I have a scorm content and I play it inside a webview in my react native application, but I want to change the style of the buttons which appear at bottom of the webview and which control stop/play/resume video ...
So is there a way to do that ?
There are a couple of ways you could approach this.
You can execute JavaScript directly on the WebView; so, you could use document.getElementById('...') to obtain a reference to the buttons you want to change, and then update the button styles, making sure to retain the onPress behaviour.
Slightly nicer; you could hide the buttons on the page altogether, and instead define some <Button />s inside of your React layout. In the onPress of your React buttons, you could execute the JavaScript you'd normally expect the WebPage buttons to execute. This would require figuring out how to trigger those handlers.
Both of these require some inspection, understanding and experimentation with the source you're trying to manipulate. I'd recommend opening up the page in your browser and using:
javascript:console.log('your');console.log('js');console.log('here);
inside your URL bar to find the commands you want to run before trying to pass them into the WebView. Alternatively, you can also inject JavaScript directly into the page if you use the browser's Inspector pane.
See: Execute JavaScript inside WebView source
The goal is a simple and clean implementation to build a pop-up window similar to the search-filters from the YouTube-App, see picture. Tapping on the half-transparent border should close the pop-up. The same pop-up is supposed to be called from several screens (within nested navigation-structures) and just give back the choices to the respective screen.
I did quite some search and documentation reading, so I seem to have the following four options:
Use an Alert window and heavily modifying the alert message, but this option does not allow me to cancel by clicking on the transparent area.
Using some promising-looking component which is very beta like react-native-popupwindow is not really an option either.
Use a modal component which claims to be a simple way to present content above an enclosing view. According to How to dim a background in react native modal? and Tap outside of modal to close modal (react-native-modal)" this seems to be a possible option.
However, some people say that you should rather use Overlay and use Modal only as a last resort.
Please advice which of the solutions you tested in real life. What do you suggest? Maybe there is even an easier solution?
Related question(s) here on StackOverflow:
Transparent overlay in React Native
Modal is totally your way to go.
My personal choice would be https://github.com/react-native-community/react-native-modal which has the best performances and flexibility overall.
OK, I'm doing some experiments with WebView-based native OSX apps, and I'm wondering:
Which are the necessary steps in order to fully camouflage it? (So, that the user - ok, a non-technical user, actually) cannot possibly understand it's a webview.
How can we eliminate the right-click menu (including the "Reload" item)?
Last but not least:
If the actual webpage content is loaded on startup (in awakeFromNib), even for a simple webpage, it takes 1-or-2 seconds before the actual content shows up. During this time, a white/empty background shows where the webview/page should be. What could I do about that? Perhaps a "loading" indicator?
Any help will be appreciated! :-)
To eliminate the right click menu implement the webView(_:contextMenuItemsForElement:defaultMenuItems:) method of WebUIDelegate protocol.
I use Ooyala video player in my project, and I need to have my own video control, so I need a way to hind its built-in video control, I found that the OOOoyalaPlayerViewController has method showControls, but the control appears when you tap the video, so is there a way to explicitly hide the controls? I've tried subclassing OOOoyalaPlayerViewController and overwrite showControls to do nothing but it did not work.
Thanks!
If you are creating custom controls, you probably want to use an OOOoyalaPlayer directly versus going through the OOOoyalaPlayerViewController- all the viewcontroller does is add controls on top of the player.
If you must use an OOOoyalaPlayerViewController, try subclassing OOControlsViewController and overwriting - (void)onTap:(UITapGestureRecognizer *)sender. The source for this is bundled with our SDK.
I have a wxTextCtrl with a vertical scrollbar. I need to capture scroll events from the text control's scrollbar. I have a handler for EVT_SCROLL but it only gets invoked on the Windows build. On wxGTK it does nothing. Is there any way to make this work?
No, EVT_SCROLL, like many other events, only works for wxWidgets windows and not the native ones.
You can use wxRichTextCtrl or wxStyledTextCtrl but you probably won't find any way to be notified about scrolling in the native GTK+ text widget.