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
bbquincar
Posts: 304
Registered: ‎08-14-2012
My Device: PlayBook, Z10, Dev C
My Carrier: Rogers
Accepted Solution

how do disable scrollview

I have a list.xml it only has 6 items and doesnt need to scroll up or down.

How do i disable scrollview . see below the code nothing eles on my page has scrollview 

 

ListView {
                id: listView
                // set object name to let listView to be discoverable from C++
                objectName: "listView"
                layout: GridListLayout {
                    cellAspectRatio: 0.79
                    orientation: LayoutOrientation.BottomToTop
                    }
                    dataModel: XmlDataModel {
                        source: "models/items.xml"
                    }
                    listItemComponents: [
                        // define component which will represent list item GUI appearence
                        ListItemComponent {
                            type: "item"
                            // list item GUI appearence component is defined in external MyListItem.qml file
                            WebItem {
                            }
                        }
                    ]

 Thanks in advance.

BlackBerry 10 game reviews for the unknown, small and indie developers. Little games with big dreams. VeryBerryGames.com | Follow @VeryBerryGames | TwoCasualCoders.com | never casual on quality
Please use plain text.
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: how do disable scrollview

There's a Cascades component called ScrollView, but you're not actually asking about it, are you?

You want to know how to disable scrolling in a ListView? Short of doing "enabled: false" on it, you can't directly do that, I think. What form of interaction do you still want to allow with the list? Would putting up a transparent overlay that blocked all touch input work?

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
Developer
bbquincar
Posts: 304
Registered: ‎08-14-2012
My Device: PlayBook, Z10, Dev C
My Carrier: Rogers

Re: how do disable scrollview

there is some movement of my images that im calling from another qml page grid.

 

so the grid.qml put the images on my main page.

i have the title of my app and picture and then grid iamges that push to their specfic qml page.

those images that are coming from my grid.gml on to my main.qml are moving or scrolling up and down not by much but i dont want them to move at all.

BlackBerry 10 game reviews for the unknown, small and indie developers. Little games with big dreams. VeryBerryGames.com | Follow @VeryBerryGames | TwoCasualCoders.com | never casual on quality
Please use plain text.
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: how do disable scrollview

In that case, why are you even using a list or grid? If you don't want the benefit of the scrolling at any time, don't use them at all... Can't you lay out the components in some other manner?

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
Developer
bbquincar
Posts: 304
Registered: ‎08-14-2012
My Device: PlayBook, Z10, Dev C
My Carrier: Rogers

Re: how do disable scrollview

new to programming seemed like the easiest way to have them appear and push to the next page.

so grid and list view have auto scroll that cant be disabled . see below for the code

 

import bb.cascades 1.0

Container {
    layout: DockLayout {
    }
    Container {
        id: mainContainer
        layout: DockLayout {
        }
        horizontalAlignment: HorizontalAlignment.Center
        topPadding: 15.0
        bottomPadding: 15.0
        leftPadding: 15.0
        rightPadding: 15.0
        ImageView {
            id: myImage
            imageSource: "asset:///images/button2.png"
            preferredWidth: 700.0
            preferredHeight: 950
        }
    }

    // The Item content an image and a text with rotation.
    Container {
        // show image
        horizontalAlignment: HorizontalAlignment.Center
        verticalAlignment: VerticalAlignment.Center
        bottomPadding: 80.0
        ImageView {
            imageSource: ListItemData.image 
        }
    }
    
    // and text below
    Container {
        verticalAlignment: VerticalAlignment.Center
        horizontalAlignment: HorizontalAlignment.Center
        preferredWidth: 170.0
        bottomPadding: 5.0
        topPadding: 200.0
        Label {
            text: ListItemData.title
            textStyle.textAlign: TextAlign.Center
            textStyle.color: Color.White
            textStyle.fontSizeValue: 7.0
            multiline: true
            horizontalAlignment: HorizontalAlignment.Center
            verticalAlignment: VerticalAlignment.Center
            textStyle.lineHeight: 1.0
        }
    }

    // Connect the onActivedChanged signal to the highlight function
    ListItem.onActivationChanged: {
        setHighlight(ListItem.active);
    }

    // Connect the onSelectedChanged signal to the highlight function
    ListItem.onSelectionChanged: {
        setHighlight(ListItem.selected);
    }
}

 

BlackBerry 10 game reviews for the unknown, small and indie developers. Little games with big dreams. VeryBerryGames.com | Follow @VeryBerryGames | TwoCasualCoders.com | never casual on quality
Please use plain text.
Contributor
bit-brad
Posts: 31
Registered: ‎11-02-2012
My Device: Dev Alpha
My Carrier: None

Re: how do disable scrollview

[ Edited ]

Hey peter9477,

 

I am having the same issue and do not want to reimplement a custom control that will layout items in a grid fashion. I have a ListView setup with GridListLayout. This made my job extreamly easy. To reimplement it would probably take several days, when all I need is to disable scrolling.

 

Setting touchPropagationMode: TouchPropagationMode.PassThrough helps. If I have items completely fill the bounds of the ListView, then the scrolling is disabled as it never receives the touch events. However if there are blank spots the ListView still receives the events and scrolls.

 

One solution would be to fill those blank spots with empty containers that intercept the touch events. I'll be opening a bug with RIM.

 

EDIT: I've opened a bug BBTEN-486

Please use plain text.
New Developer
sumithpdd
Posts: 11
Registered: ‎03-14-2013
My Device: z10 , q10
My Carrier: vodaphone

Re: how do disable scrollview

So, there is no way to stop the listview to scroll. i.e disable listview scroll

Please use plain text.