Reputation: 1397
I am using the ds.slideMenu
widget, that has the following view:
<Alloy>
<View id="containerview">
<View id="leftMenu">
<TableView id="leftTableView" />
</View>
<View id="movableview">
<View id="shadowview">
<View id="navview">
<Button id="leftButton" />
</View>
<View id="contentview" />
</View>
</View>
</View>
</Alloy>
and the view to display the webview is the following one:
<Alloy>
<View class="container">
<WebView id="webview" url="myremoteurlhere" onLoad="construct"/>
</View>
</Alloy>
To introduce what the code of ds.slideMenu does, here's what happens when you change your view:
function rowSelect(e) {
if (Alloy.Globals.currentView.id != e.row.customView) {
$.ds.contentview.remove(Alloy.Globals.currentView);
currentView = Alloy.createController(e.row.customView).getView();
currentView.touchEnabled = true;
Alloy.Globals.currentView = currentView;
$.ds.contentview.add(currentView);
}
}
movableview
has an addEventListener
for 'touchstart', 'touchend', 'touchmove' and for sure is getting the event instead of my webview. Now, the webview is loaded without problems, but on the iOS simulator the touch event does not work. Clicking on the loaded page, nothing happens.
Any hints, please?
Upvotes: 0
Views: 1016
Reputation: 1397
The answer is the willHandleTouches webview
property set to false
.
From the official documentation:
Explicitly specifies if this web view handles touches. On the iOS platform, if this web view or any of its parent views have touch listeners, the Titanium component intercepts all touch events. This prevents the user from interacting with the native web view components. Set this flag to false to disable the default behavior. Setting this property to false allows the user to interact with the native web view and still honor any touch events sent to its parents. No touch events will be generated when the user interacts with the web view itself. Set this flag to true if you want to receive touch events from the web view and the user does not need to interact with the web content directly.
So
<WebView id="<mywebviewid>" willHandleTouches=false url="<myurlhere>"/>
will work as expected.
Upvotes: 1