2014-10-10 178 views
0

我嘗試在Titanium中實現可旋轉和縮放的圖像。我設法使這個工作正常,但我希望能夠滾動圖像周圍,如果它比imageView更大。我嘗試了幾件事情,包括添加eventListeners並使用zIndex將正確的視圖移到前面,但沒有任何幫助。我也嘗試了bubbleParent函數,沒有任何其他結果。我希望你們中的一些人知道如何達到預期的行爲。Titanium scrollView沒有反應

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"); 
}); 
+0

試一下:Ti.UI.createScrollableView – 2014-10-10 12:55:50

回答

0

所有我終於通過這種使用此模塊的工作後:TiTouchImageView。如果您在導入/使用時遇到任何問題,請參閱我的other question