【发布时间】:2015-07-25 19:28:44
【问题描述】:
我正在使用ds.slideMenu 小部件,它具有以下视图:
<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>
显示 webview 的视图如下:
<Alloy>
<View class="container">
<WebView id="webview" url="myremoteurlhere" onLoad="construct"/>
</View>
</Alloy>
为了介绍 ds.slideMenu 的代码做了什么,下面是当你改变你的视图时会发生什么:
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 有一个 addEventListener 用于 'touchstart'、'touchend'、'touchmove' 并且肯定会得到事件而不是我的 webview。现在,webview 加载没有问题,但在 iOS 模拟器上,触摸事件不起作用。点击加载的页面,没有任何反应。
有什么提示吗?
【问题讨论】:
标签: ios webview titanium titanium-alloy