Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
Posts: 435
Registered: ‎09-20-2011
My Device: Z10 LE, Playbook, DevAlpha C, 9900, 9380
My Carrier: Vodafone
Accepted Solution

ScrollView not scrolling

Hi all,

 

Can anyone point out what i am doing wrong.....

 

 

ScrollView {
                        scrollViewProperties.scrollMode: ScrollMode.Vertical
                        scrollViewProperties.initialScalingMethod: ScalingMethod.Fill
                        layoutProperties: AbsoluteLayoutProperties {
                            positionY: 187.0
                        }
                        scrollViewProperties.overScrollEffectMode: OverScrollEffectMode.OnScroll
                        touchPropagationMode: TouchPropagationMode.Full
                        overlapTouchPolicy: OverlapTouchPolicy.Deny
                        Container {
                            Container {
                                id: mContainer
                                ImageView {
                                    imageSource: "asset:///images/m.png"
                                }
                            }
                            Container {
                                id: pContainer
                                ImageView {
                                    imageSource: "asset:///images/p.png"
                                }
                            }
                        }
                    }

 

Thanks

Developer
Posts: 435
Registered: ‎09-20-2011
My Device: Z10 LE, Playbook, DevAlpha C, 9900, 9380
My Carrier: Vodafone

Re: ScrollView not scrolling

Please have a look at this query.... I am still didnt get what i am doing wrong.
Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: ScrollView not scrolling

What problem are you getting?


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
Developer
Posts: 435
Registered: ‎09-20-2011
My Device: Z10 LE, Playbook, DevAlpha C, 9900, 9380
My Carrier: Vodafone

Re: ScrollView not scrolling

I am already mentioned the scrollview is not scrolling. When i am trying to scroll a portion of it is getting scrolled when i take my hand back from the screen it goes back to original state
Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: ScrollView not scrolling

Okay so I tried your code and it all works perfectly for me.
So I ask again what EXACTLY is your problem?

One thing to check is if your image is bigger than the scroll window, if not then no scrolling.

If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: ScrollView not scrolling

Did you test this piece of code outside any other controls?

I suggest that before posting code you try this.

If it works then move up a container and try again, repeat until it stops working.

 

If you are still stuck after this then post *that* piece of code.


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
Highlighted
Developer
Posts: 541
Registered: ‎05-17-2009
My Device: Not Specified

Re: ScrollView not scrolling

The problem comes from the container that this ScrollView is contained in. Putting a ScrollView inside an AbsoluteLayout can cause the behaviour you are seeing.

 

If you can paste the code containing your above code, that may help us help you.

Developer
Posts: 435
Registered: ‎09-20-2011
My Device: Z10 LE, Playbook, DevAlpha C, 9900, 9380
My Carrier: Vodafone

Re: ScrollView not scrolling

[ Edited ]

Hi,

 

I think it is because of using absolute layout, because when i only having scrollview in the container it is scrolling. 

import bb.cascades 1.2


TabbedPane {
    showTabsOnActionBar: false
    objectName: "objectW"
    Tab {
        title: "My Location"
        imageSource: "asset:///images/location_imgsrc.png"
        NavigationPane {
            id:navPaneLocation
            Page {
                resizeBehavior: PageResizeBehavior.None
                Container {
                    id: containerID
                    layout: AbsoluteLayout {}
                    ImageView {
                        layoutProperties: AbsoluteLayoutProperties {
                            positionX: 0.0
                            positionY: 0.0
                        }
                        imageSource: "asset:///images/topbar.png"
                    }
                    ImageView {
                        layoutProperties: AbsoluteLayoutProperties {
                            positionX: 10.0
                            positionY: 10.0
                        }
                        imageSource: "asset:///images/w.png"
                    }
                    Label {
                        text: "Mumbai"
                        layoutProperties: AbsoluteLayoutProperties {
                            positionX: 100.0
                            positionY: 20.0
                        }
                        textFormat: TextFormat.Plain
                        autoSize.maxLineCount: 1
                        textStyle.fontSize: FontSize.Medium
                        textStyle.color: Color.DarkGreen
                        textStyle.textAlign: TextAlign.Center
                    
                    }
                    ImageView {
                        layoutProperties: AbsoluteLayoutProperties {
                            positionX: 560.0
                            positionY: 10.0
                        }
                        imageSource: "asset:///images/search.png"
                    }
                    ImageView {
                        layoutProperties: AbsoluteLayoutProperties {
                            positionX: 640.0
                            positionY: 10.0
                        }
                        imageSource: "asset:///images/direction_up.png"
                    }
                    ImageView {
                        layoutProperties: AbsoluteLayoutProperties {
                            positionX: 0.0
                            positionY:94.0
                        }
                        imageSource: "asset:///images/location_name_bg.png"
                    }
                    Label {
                        text: "Sn"
                        layoutProperties: AbsoluteLayoutProperties {
                            positionY: 110.0
                        }
                        textFormat: TextFormat.Plain
                        autoSize.maxLineCount: 1
                        textStyle.fontSize: FontSize.Medium
                        textStyle.color: Color.White
                        textStyle.textAlign: TextAlign.Left
                        horizontalAlignment: HorizontalAlignment.Right
                    
                    }
                    ScrollView {
                        preferredHeight: 1000
                        scrollViewProperties.scrollMode: ScrollMode.Vertical
                        scrollViewProperties.initialScalingMethod: ScalingMethod.Fill
                        layoutProperties: AbsoluteLayoutProperties {
                            positionY: 187.0
                        }
                        scrollViewProperties.overScrollEffectMode: OverScrollEffectMode.OnScroll
                        touchPropagationMode: TouchPropagationMode.Full
                        overlapTouchPolicy: OverlapTouchPolicy.Deny
                        Container {
                            Container {
                                id: mapContainer
                                ImageView {
                                    imageSource: "asset:///images/m.png"
                                }
                            }
                            Container {
                                id: panaromaContainer
                                ImageView {
                                    imageSource: "asset:///images/p.png"
                                }
                            }
                        }
                    }
                
                }
                actions: [
                    ActionItem {
                        id: settings
                        title: "Settings"
                        ActionBar.placement: ActionBarPlacement.InOverflow
                        onTriggered: {
                            // var profilePage = helpPage.createObject();
                            // navPane.push(profilePage);
                        }
                    },
                    ActionItem {
                        id: about
                        title: "About"
                        ActionBar.placement: ActionBarPlacement.InOverflow
                        onTriggered: {
                            // var profilePage = aboutPage.createObject();
                            // navPane.push(profilePage);
                        }
                    },
                    ActionItem {
                        id: feedback
                        title: "Feedback"
                        ActionBar.placement: ActionBarPlacement.InOverflow
                        onTriggered: {
                            // var profilePage = aboutPage.createObject();
                            // navPane.push(profilePage);
                        }
                    }
                ]
            
            }/////end of page
        }// end of navigation pane
    }///end of tab1
    
    Tab {
        title: "Directions"
        imageSource: "asset:///images/directions_imgsrc.png"
        NavigationPane {
            id:navPaneDirections
            Page {
                resizeBehavior: PageResizeBehavior.None
                actions: [
                    ActionItem {
                        id: settings1
                        title: "Settings"
                        ActionBar.placement: ActionBarPlacement.InOverflow
                        onTriggered: {
                            // var profilePage = helpPage.createObject();
                            // navPane.push(profilePage);
                        }
                    },
                    ActionItem {
                        id: about1
                        title: "About"
                        ActionBar.placement: ActionBarPlacement.InOverflow
                        onTriggered: {
                            // var profilePage = aboutPage.createObject();
                            // navPane.push(profilePage);
                        }
                    },
                    ActionItem {
                        id: feedback1
                        title: "Feedback"
                        ActionBar.placement: ActionBarPlacement.InOverflow
                        onTriggered: {
                            // var profilePage = aboutPage.createObject();
                            //  navPane.push(profilePage);
                        }
                    }
                ]
            }/////end of page
        }// end of navigation pane
    }///end of tab2
    
    Tab {
        title: "Change City"
        imageSource: "asset:///images/changecity_imgsrc.png"
        NavigationPane {
            id:navPaneCity
            Page {
                resizeBehavior: PageResizeBehavior.None
                actions: [
                    ActionItem {
                        id: settings2
                        title: "Settings"
                        ActionBar.placement: ActionBarPlacement.InOverflow
                        onTriggered: {
                            //  var profilePage = helpPage.createObject();
                            //  navPane.push(profilePage);
                        }
                    },
                    ActionItem {
                        id: about2
                        title: "About"
                        ActionBar.placement: ActionBarPlacement.InOverflow
                        onTriggered: {
                            // var profilePage = aboutPage.createObject();
                            // navPane.push(profilePage);
                        }
                    },
                    ActionItem {
                        id: feedback2
                        title: "Feedback"
                        ActionBar.placement: ActionBarPlacement.InOverflow
                        onTriggered: {
                            // var profilePage = aboutPage.createObject();
                            // navPane.push(profilePage);
                        }
                    }
                ]
            }/////end of page
        }// end of navigation pane
    }///end of tab3
    
    attachedObjects: [
        ImagePaintDefinition {
            id: bg
            repeatPattern: RepeatPattern.Fill
            imageSource: "asset:///images/topbar.png"
        }
    ]

}/////end of tabbed pane