Can we zoom in and out using views in appecelerator titanium?
Is it possible to zoom in and zoom out in a view just like using a double tap or pinch functionality? If so can we still get the same coordinates or different coordinates after zooming in?
If I have a view of height 100 and width 100 and when I click on the end of the view it obviously returns y-position as 100.
Another question I have is after zoom using a pinch or doubletap, will it return the end y co-ordinate as 100 or will it return a different value since we zoomed-in?
If this is not po开发者_运维问答ssible, is there an an alternative?
Thank you.
You can add the view to a scrollView. When you've done this you can zoom in and out by pinching.
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
});
After you create this you can add your view to it
scrollView.add(view)
Hope this helps!
Tjeu
精彩评论