繁体   English   中英

钛scrollView不反应

[英]Titanium scrollView does not react

我尝试在Titanium中实现可旋转和缩放的图像。 我设法使它正常工作,但是如果它比imageView大,我希望能够滚动它。 我尝试了几种方法,包括添加eventListeners以及使用zIndex将适当的视图置于最前面,但没有任何帮助。 我还尝试了bubbleParent函数,没有任何其他结果。 我希望你们中的一些人知道如何实现所需的行为。

XML:

<ScrollView id="imageScrollView">
    <View id="pictureView">
        <ImageView id="picture" ></ImageView>
    </View>
</ScrollView>

TSS:

"#imageScrollView": {
    top: "0",
    left: "0",
    height: "120",
    width: "47%",
    showHorizontalScrollIndicator: "true",
    showVerticalScrollIndicator: "true",
    maxZoomScale: "5",
    minZoomScale: "1",
    backgroundColor: "white",
    scrollingEnabled: "true",
    borderWidth: "1",
    zIndex: "1050"
}
"#pictureView": {
    top: "0",
    left: "0",
    height: "100%",
    width: "100%",
    bubbleParent: true
}
"#picture": {
    top: "0",
    left: "0",
    height: "100%",
    width: "100%",
    borderWidth: "3",
    borderColor: "red",
    bubbleParent: true

}

和我的js

$.imageScrollView.addEventListener("scroll", function(e) {
    Ti.API.info("Triggered event");
});

$.pictureView.addEventListener("scroll", function(e) {
    Ti.API.info("Triggered event");
});

毕竟,我最终通过使用以下模块来管理该工作: TiTouchImageView 如果您在导入/使用它时遇到任何问题,请参阅我的其他问题

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM