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
Contributor
Posts: 15
Registered: ‎01-13-2013
My Device: BlackBerry Classic
My Carrier: O2 CZ

Changing stacklayout to gridlayout in listview

How can I do switching between grid/stack layout of the listview? Or how to achieve replacing list with rows by list of tiles? Can anyone help? Thanks!

Developer
Posts: 19
Registered: ‎07-02-2013
My Device: BlackBerry Q10
My Carrier: Telus

Re: Changing stacklayout to gridlayout in listview

How about something like this:

 

Container

{

     ListView {

          id: listView

          layout: StackListLayout {

                id: stackLayout

          }

     }

 

     Button {

           text: "Switch"

           onClicked: {

                   listView.layout = gll;

           }

     }

 

     attachedObjects: [

           GridListLayout {

                id: gll

           }

     ]

}