B4J Question [abmaterial 4.25][soved]container.setfixpostion doesn't work!

liulifeng77

Active Member
Licensed User
Longtime User
in buildpage
B4X:
Dim cont_control As ABMContainer
    cont_control.Initialize(page,"cont_control","")
    cont_control.AddRows(1,True,"").AddCellsOS(4,0,0,0,3,3,3,"")
    cont_control.BuildGrid
  
    Dim firstshow1 As ABMButton
    Dim hereshow1 As ABMButton
    Dim Nextshow1 As ABMButton
    Dim prevshow1 As ABMButton
  
    firstshow1.InitializeFloating(page,"firstshow1","mdi-image-filter-1","")
    hereshow1.InitializeFloating(page,"hereshow1","mdi-hardware-keyboard-arrow-down","")
    Nextshow1.InitializeFloating(page,"nextshow1","mdi-hardware-keyboard-arrow-right","")
    prevshow1.InitializeFloating(page,"preshow1","mdi-hardware-keyboard-arrow-left","")
  
    cont_control.Cell(1,1).AddArrayComponent(firstshow1,"command")
    cont_control.Cell(1,2).AddArrayComponent(hereshow1,"command")
    cont_control.Cell(1,3).AddArrayComponent(prevshow1,"command")
    cont_control.Cell(1,4).AddArrayComponent(Nextshow1,"command")
    cont_control.IsResponsiveContainer=True
    cont_control.SetFixedPosition("30px", "", "56px", "")
page shows nothing.
something I missed?

add: if i add this line:
page.AddFloatingContainer(cont_control,ABM.FLOATING_FROMBOTTOM,"50px")
the buttons doesn't work.

thanks!
 
Last edited:

alwaysbusy

Expert
Licensed User
Longtime User
Try it in ConnectPage() instead of in BuildPage(). See also my remarks in the code:

B4X:
Dim cont_control As ABMContainer
cont_control.Initialize(page,"cont_control","")
cont_control.AddRows(1,True,"").AddCellsOS(4,0,0,0,3,3,3,"")
cont_control.BuildGrid
 
Dim firstshow1 As ABMButton
Dim hereshow1 As ABMButton
Dim Nextshow1 As ABMButton
Dim prevshow1 As ABMButton
 
firstshow1.InitializeFloating(page,"firstshow1","mdi-image-filter-1","")
hereshow1.InitializeFloating(page,"hereshow1","mdi-hardware-keyboard-arrow-down","")
Nextshow1.InitializeFloating(page,"nextshow1","mdi-hardware-keyboard-arrow-right","")
prevshow1.InitializeFloating(page,"preshow1","mdi-hardware-keyboard-arrow-left","")
 
cont_control.SetFixedWidth("50%") ' <----------------- set a prefered width
cont_control.Cell(1,1).AddArrayComponent(firstshow1,"command")
cont_control.Cell(1,2).AddArrayComponent(hereshow1,"command")
cont_control.Cell(1,3).AddArrayComponent(prevshow1,"command")
cont_control.Cell(1,4).AddArrayComponent(Nextshow1,"command")
cont_control.IsResponsiveContainer=True
cont_control.SetFixedPosition("", "10px", "", "10px") ' <--------------- you were setting the top left values, but then later are asking for the ABM.FLOATING_FROMBOTTOM, these two should match: or the top/left + ABM.FLOATING_FROMTOP OR bottom/right + ABM.FLOATING_FROMBOTTOM
  
page.AddFloatingContainer(cont_control,ABM.FLOATING_FROMBOTTOM,"0px")
 
Upvote 0
Top