B4J Question [ABMaterial] How to align to the bottom of the cell

jinyistudio

Well-Known Member
Licensed User
Longtime User
Hi

I put a ABMContainer into a page.cell(1,1). Could i align it to the bottom of the cell ? o_O
 

Cableguy

Expert
Licensed User
Longtime User
Upvote 0

alwaysbusy

Expert
Licensed User
Longtime User
There is absolutely nothing wrong with using the Margins, but here may be another approach:

B4X:
page.InjectCSS(".alignbottom {position: absolute;bottom:0 }")

Dim btn As ABMButton
btn.InitializeFlat(page, "btn", "", "", "Bottom", "")
btn.HTMLAddClass("alignbottom")
page.Cell(3,1).SetFixedHeight(100,False)    
page.Cell(3,1).AddComponent(btn)

Result:

1610089613135.png

Alwaysbusy
 
Upvote 0

jinyistudio

Well-Known Member
Licensed User
Longtime User
It doesn't work o_O ABM is 4.30

I put page.InjectCSS(".alignbottom {position: absolute;bottom:0 }") in the BuildPage

B4X:
Dim btn1 As ABMButton
btn1.Initializefloating(page, "tkselect", "mdi-action-list", "darkred")
btn1.size = ABM.BUTTONSIZE_NORMAL
btn1.HTMLAddClass("alignbottom")
body.Cell(1,2).AddArrayComponent(btn1,"tokenselect")
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
It doesn't work o_O ABM is 4.30

I put page.InjectCSS(".alignbottom {position: absolute;bottom:0 }") in the BuildPage

B4X:
Dim btn1 As ABMButton
btn1.Initializefloating(page, "tkselect", "mdi-action-list", "darkred")
btn1.size = ABM.BUTTONSIZE_NORMAL
btn1.HTMLAddClass("alignbottom")
body.Cell(1,2).AddArrayComponent(btn1,"tokenselect")
Put it in connect page... i place all my controls there. On the build page i mostly only create the needed grids
 
Upvote 0

alwaysbusy

Expert
Licensed User
Longtime User
page.InjectCSS(".alignbottom {position: absolute;bottom:0 }") in the BuildPage
That is where you went wrong. It is an Injection of CSS so the page must already exist in your browser. If you want to do it in BuildPage, make a seperate .css file and use Page.AddExtraCSSFile()
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
Can this approach be used to add a hover evet to a button??
 
Upvote 0
Top