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: 20
Registered: ‎09-12-2012
My Device: Developer
My Carrier: Docomo

bb10 Grid Layout Usage

i want to divide page into two coloums so which layout i have to use and how and how to place components(buttons etc ) in list view 

Developer
Posts: 80
Registered: ‎09-03-2012
My Device: 9810
My Carrier: Vodafone

Re: bb10 Grid Layout Usage

[ Edited ]

Try this for dividing your page into two halves

 

Here the parent container layout is distributed among  two child container (left child and right child)

 

main.qml

 

import bb.cascades 1.0

Page {
    content: Container {
        id: parentContainer
        layout: StackLayout {
            layoutDirection: LayoutDirection.LeftToRight
        }
        Container {
            id: leftChild
            background: Color.Red
            layout: StackLayout {
                layoutDirection: LayoutDirection.TopToBottom
            }
            layoutProperties: StackLayoutProperties {
                verticalAlignment: VerticalAlignment.Fill
                horizontalAlignment: HorizontalAlignment.Fill
                spaceQuota: 1.0
            }
            Button {
                text: "Button First"
            }
        }
        Container {
            id: rightChild
            background: Color.Green
            layout: StackLayout {
                layoutDirection: LayoutDirection.TopToBottom
            }
            layoutProperties: StackLayoutProperties {
                spaceQuota: 1.0
                verticalAlignment: VerticalAlignment.Fill
                horizontalAlignment: HorizontalAlignment.Fill
            }
            Button {
                text: "Button Second"
            }
        }
    }
}

 

 

 

For ListView problem refer this

 

https://developer.blackberry.com/cascades/documentation/ui/lists/list_view.html

 

 

Always Success
Retired
Posts: 138
Registered: ‎05-11-2012
My Device: Developer
My Carrier: Developer

Re: bb10 Grid Layout Usage

Did MFSI's suggestion help you make progress?

 

Graham

Contributor
Posts: 20
Registered: ‎09-12-2012
My Device: Developer
My Carrier: Docomo

Re: bb10 Grid Layout Usage

ya its working  is it possible to do this in single container

Highlighted
Retired
Posts: 138
Registered: ‎05-11-2012
My Device: Developer
My Carrier: Developer

Re: bb10 Grid Layout Usage

Excellent, can we close this thread off ?

 

Graham


 

Regular Contributor
Posts: 94
Registered: ‎12-02-2011
My Device: non-Blackberry user
My Carrier: none

Re: bb10 Grid Layout Usage

Say you want to do this with three rows and two columns.  The first column is the label, the second column is the TextField.  Seems the trade off of doing it this way is that you get left right aligned but seems impossible to align vertically.