B4J Question [abmaterial] Is there anyway to set the button's width?

liulifeng77

Active Member
Licensed User
Longtime User
btn.size = ABM.BUTTONSIZE_SMALL,
it just change the button's height!

I need a small button.

thanks!
 

Harris

Expert
Licensed User
Longtime User
Maybe you can use a floating button, small size? It has only an icon but it is quite small.

On small devices, i used this.. Actually, I kept this design for all sizes since I didn't need to adjust it according to device size.

It puts a 4 letter text label next to the floating button for "some" description...
Maybe someday you can add an option to floating that will allow you to define this... someday...

Small devices are a real bitch to deal with when you initially design for desktop.

Is it just me or have you noticed this too? It is hard to get anyone to fire up their desktop (laptop) to test your stuff.. EVERYONE uses their phone...

Guess we should all design for phone initially - then mod for desktop....


B4X:
    Dim SaveBtn As ABMButton
    SaveBtn.InitializeFloating(page, "SaveBtn", "mdi-toggle-check-box","green")
    inp.Footer.Cell(1,1).AddComponent(SaveBtn)  
    Dim lbl1 As ABMLabel
    lbl1.Initialize(page, "lbl1", "Save", ABM.SIZE_SPAN,  False, "")
    inp.Footer.Cell(1,1).AddComponent(lbl1)


    Dim CancelBtn As ABMButton
    CancelBtn.InitializeFloating(page, "CancelBtn",  "mdi-navigation-cancel", "green")
    inp.Footer.Cell(1,2).AddComponent(CancelBtn)
    Dim lbl2 As ABMLabel
    lbl2.Initialize(page, "lbl2", "Back", ABM.SIZE_SPAN,  False, "")
    inp.Footer.Cell(1,2).AddComponent(lbl2)
  
  
    Dim AttBtn As ABMButton
    AttBtn.InitializeFloating(page, "AttBtn", "mdi-image-camera-alt", "green")
    inp.Footer.Cell(1,3).AddComponent(AttBtn)
    Dim lbl3 As ABMLabel
    lbl3.Initialize(page, "lbl3", "Pic", ABM.SIZE_SPAN,  False, "")
    inp.Footer.Cell(1,3).AddComponent(lbl3)

  
    Dim NoteBtn As ABMButton
    NoteBtn.InitializeFloating(page, "NoteBtn", "mdi-notification-event-note", "green")
    inp.Footer.Cell(1,4).AddComponent(NoteBtn)
    Dim lbl4 As ABMLabel
    lbl4.Initialize(page, "lbl4", "Note", ABM.SIZE_SPAN,  False, "")
    inp.Footer.Cell(1,4).AddComponent(lbl4)

More code, but at least we can do this... Thanks ab.
Looks like this...

footer.png
 
Last edited:
Upvote 0
Top