Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Hlayout and align

    I am trying to align members of Layout like this:
    isc.HLayout.create({
    width: 315,
    align: "center",
    members:[
    AddNewTrain, RemoveTrain]
    }),

    but the buttins are left aligned. What am I doing wrong?

    #2
    Hi Mark,
    Layout.align actually only supports left / right alignment or top/bottom alignment for VLayouts, not "center".
    We'll try to make sure this is made clearer in the documentation.

    In the meantime, if you think this a valuable feature, feel free to add a request for it in the wishList forum.

    There are a couple of ways to achieve the same effect. Here's one approach you can try: embed your HLayout inside a VLayout and use the layoutAlign property to center it.

    Code:
    isc.VLayout.create({
        width:315,
        members:[
            isc.HLayout.create({
                // small so it sizes to the buttons
                width:50,
                // layoutAlign:"center" so it is centered horizontally
                layoutAlign:"center",
                autoDraw:false,
                members:[AddNewTrain, RemoveTrain]
            })
        ]
    })

    Comment

    Working...
    X