我们可以使用appecelerator钛中的视图放大和缩小吗?

Pra*_*Raj 2 view zooming titanium pinch appcelerator-mobile

是否可以像在使用双击或捏合功能一样放大和缩小视图?如果是这样,我们仍然可以在放大后获得相同的坐标或不同的坐标?

如果我有高度100和宽度100的视图,当我点击视图的末尾时,它显然将y位置返回为100.

我的另一个问题是使用捏合或双击进行缩放后,它会将结束y坐标返回为100还是会因为我们放大而返回不同的值?

如果这是不可能的,还有其他选择吗?

谢谢.

Tje*_*les 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
}); 
Run Code Online (Sandbox Code Playgroud)

创建后,您可以添加视图

scrollView.add(view)

希望这可以帮助!

Tjeu