blackberryqmlblackberry-cascades

Blackberry Cascades Pinch to Zoom


So I've recently started working with BB cascades and is currently working on the camera component. Here's my code with which I 'am currently facing problem:

import bb.cascades 1.2

Page {

    property string name: ""

    function setSource(source) {
        name = source;
        gestureContainer.resetViewableArea();
    }

    Container {
        layout: StackLayout {
        }
        id: gestureParent

        horizontalAlignment: HorizontalAlignment.Center
        verticalAlignment: VerticalAlignment.Center

        ScrollView {
            id: gestureContainer
            scrollViewProperties {
                scrollMode: ScrollMode.Both
            }

            scrollRole: ScrollRole.Main
            scrollViewProperties.minContentScale: 1.0
            scrollViewProperties.maxContentScale: 8.0
            scrollViewProperties.pinchToZoomEnabled: true
            scrollViewProperties.overScrollEffectMode:OverScrollEffectMode.Default

            ImageView {
                id: gestureImage
                imageSource: name
            }
        } // ScrollView
    } // Container

}

So the problem here is whenever I run the following code and open any image from my gallery, pre zoomed in version of image loads and I'am not able to zoom out of it but I can zoom in further(loaded image has zoomed value of somewhere around 8.0 of maxcontentscale).


Solution

  • The code is correct and works on a BlackBerry Passport with OS 10.3.1.