2011-07-01 39 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

相关问题