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
New Developer
tushar886
Posts: 75
Registered: ‎08-15-2013
My Device: blackberry curve 9630

Blackberry Cascades Buttons in single line

Hi,

 

I have written a cascades application where i am using two buttons.

 

When i am running the app both buttons are coming vertically.

 

I want both buttons to come in single line adjacent to each other which layout should i use .

 

Please tell mw w.r.t my code below:-

 

 Button {
               // horizontalAlignment: HorizontalAlignment.Center
                text: "Log in"
                id: login
                onClicked: {
                   
                   /* if (email.text == "" || password.text == "") {
                        //display error
                        alertDialog.show();
                        return;
                    }
*/
                    if (app.checkLogin(username.text, password.text)) {
                        var page = secondPageDefinition.createObject();
                        navigationPane.push(page);
                    } 
                }
            }
            Button {
               // horizontalAlignment: HorizontalAlignment.Center
               text: "Clear"
               id: clear
               onClicked: {
                   username.text = "";
                   password.text = "";
               }
            }

 

.

Developer
greenmr
Posts: 919
Registered: ‎03-20-2013
My Device: Red LE Developer Z10

Re: Blackberry Cascades Buttons in single line

Put your buttons in a Container then specify the layour orientation:

 

Container {
    layout: StackLayout {
        orientation: LayoutOrientation.LeftToRight
    }
    Button {
    }
    Button {
    }
}

 



Developer of Built for BlackBerry certified multiFEED RSS/Atom feed reader and aggregator.