2011-07-01 38 views
2

是否可以在視圖中放大和縮小,就像使用雙擊或縮放功能一樣?如果是這樣,放大後仍然可以得到相同的座標或不同的座標?我們可以放大和縮小使用鈦金屬前視圖嗎?

如果我有高度100的視圖和寬度100和當我點擊視圖的結束它顯然返回爲100

另一個問題我有使用捏或doubletap變焦之後y位置,它是否會將最終的y座標返回爲100,或者是否會因爲放大而返回不同的值?

如果這是不可能的,是否有一個替代方案?

謝謝。

回答

6

您可以將視圖添加到scrollView。當你這樣做時,你可以通過捏放大和縮小。

var scrollView = Titanium.UI.createScrollView({ 
    contentWidth: 'auto', 
    contentHeight: 'auto', 

    top: 0, 
    bottom: 0, 

    showVerticalScrollIndicator: true, 
    showHorizontalScrollIndicator: true, 

    //Here you can determine the max and min zoom scale 
    maxZoomScale: 100, 
    minZoomScale: 0.1, 

//With this property you can set the default zoom 
    zoomScale: 1 
}); 

創建之後,你可以將您的視圖添加到它

scrollView.add(view)

希望這有助於!

Tjeu

相關問題