zoomScale on a ScrollView
I'm trying to zoom into a scroll view, in fact I've a label inside a scrollview that I want to make bigger for the user.
I use this code on a button
zoom.addEventListener("click", function() {
myScroll.zoomScale=4;
});
/* where zoom is mybutton and myScroll the scrollView */
And there's no way I can have it work. What does zoomScale really mean?
3 Answers
-
Accepted Answer
The soomScale property can only be used while you are pinching on a view.
e.g.
var scrollView = Titanium.UI.createScrollView({ contentWidth:'auto', contentHeight:'auto', top:0, showVerticalScrollIndicator:true, showHorizontalScrollIndicator:true minZoomScale:0, // your view can not zoom out smaller then 100% maxZoomScale:10, // your view can zoom in with a factor 10 (1000% ?) zoomScale:5 // default zoomed in stage when view is added on window (500%) });
If you want the lavel to be bigger, just modify the fontsize instead, otherwise youw whole view will zoom also.
-
Thanks for your help, in fact I figured out that the zoom doesn't work if the max and min zoom properties are not defined.
I also tried setting the font size but when I set a bigger font size on a text that's too short to scroll, the scrollable state is not fired automatically and I'm not able to scroll the biggertext I get. -
I was struggling to get this working, it would appear I needed to explicitly set the zoomScale property in the scrollView declaration. Then in other parts of the code if I set the zoomScale it changes. Before doing that it was ignoring it.. Weird.. (1.8.0.1)