B4J Question [ABMaterial] align button right of screen

jayel

Active Member
Licensed User
Longtime User
Hello,

When I add a button on teh second cell of the row I want to right align the button. Float-right in css.
How can I to that?

upload_2016-9-8_14-43-22.png
 

alwaysbusy

Expert
Licensed User
Longtime User
You have to create a cell theme for this:

theme.AddCellTheme("alignright")
theme.Cell("alignright").Align = ABM.CELL_ALIGN_RIGHT

This theme can be used designing the grid:

page.AddRows(1,True, "").AddCellsOS(3,0,0,0,4,4,4,"alignright")

now, components added to this cell should align to the right.
 
Upvote 0

jayel

Active Member
Licensed User
Longtime User
OK but on the same row 2 cells one align left and one align right

B4X:
page.AddRows(2,"True","").AddCellsOS(2,0,0,0,6,6,6,"alignright")

This doens't do it.
 
Upvote 0

jayel

Active Member
Licensed User
Longtime User
I suppose if I want to also vertrical align center I have to do this ?
B4X:
MyTheme.AddCellTheme("alignright")
    MyTheme.Cell("alignright").Align = ABM.CELL_ALIGN_RIGHT
    MyTheme.Cell("alignright").VerticalAlign = ABM.CELL_ALIGN_CENTER

Right?
 
Upvote 0
Top