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

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
Posts: 1,163
Registered: ‎03-20-2013
My Device: Red LE Developer Z10
My Carrier: Fido

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.  multiFEED Icon

Play nice: Clicking Like Button on posts that helped you not only encourages others to continue sharing their experience, but also improves your own rating on this board. Also, don't forget to accept a post if it solves your problem or answers your question.