Sub BuildFooterFixed(page As ABMPage,PaddingBotton As Int,theme As String)
page.isFixedFooter= True
' because we have a fixed footer at the bottom, we have to adjust the padding of the body in pixels
page.PaddingBottom = PaddingBotton
page.Footer.AddRowsM(1, True,4,4, "").AddCellsOSMP(6,0,0,0,2,2,2,0,0,0,0, "")
page.Footer.BuildGrid 'IMPORTANT once you loaded the complete grid AND before you start adding components
'
page.Footer.UseTheme(theme)
End Sub
I put two button into the cell(1,5) cell(1,6) of grid of footer. Why does its showing position incorrectly !?
B4X:
Shared.BuildFooterFixed(page,200,"")
Dim btn2 As ABMButton
btn2.InitializeRaised(page, "svgsave", "mdi-navigation-cancel", "", "存檔", "darkgreen")
page.Footer.Cell(1,6).AddComponent(btn2)
Dim btn3 As ABMButton
btn3.InitializeRaised(page, "svgdelete", "mdi-content-add-circle", "", "刪除", "darkgreen")
page.Footer.Cell(1,5).AddComponent(btn3)
The above definition will add one row with two content cells. The row begins with an offset spanning 8 grid cells followed by the content cells which span 2 grid cells each.
8 + 1x2 + 1x2 = 12 grid cells.
The offset consumes 8 grid cells of the row, that means the content cells are now at (1,1) and (1,2).
B4X:
Shared.BuildFooterFixed(page,200,"")
Dim btn2 As ABMButton
btn2.InitializeRaised(page, "svgsave", "mdi-navigation-cancel", "", "存檔", "darkgreen")
page.Footer.Cell(1,2).AddComponent(btn2)
Dim btn3 As ABMButton
btn3.InitializeRaised(page, "svgdelete", "mdi-content-add-circle", "", "刪除", "darkgreen")
page.Footer.Cell(1,1).AddComponent(btn3)
This means that the two grid cells are not wide enough for the content as cell (1,2) is wrapping. You could reduce the offset and widen the content cells but that probably won't give the expected results.
A better solution is to nest the buttons in a container, then place them in a row and use an offset/cells to position the container. That gives you more control of the location on the page.
Here's an example of a row with two content-cells and containers holding the content. Note that the left container is left justified while the right container (Github, GooglePlus, and LinkedIn buttons) is aligned right.