B4J Question Rearrange Visible Buttons

Hello Everyone!

I 'm new to B4x and I'm trying to create an app using B4XPages.
I want to change the visibility of some buttons based on a certain value (done that). Moreover I want those buttons rearranged, so that the visible buttons would look better. For example if i had 5 Buttons and only made the 2 visible I would like it to look like this:
Button1
Button 4

And not like this:
Button 1

Button 4
Please Help!!
 
Solution
Why not add the buttons to a CustomListView? You can then add and remove items as needed.

The other option is to actually implement the layout changes you are talking about. Make sure that all buttons are declared as B4XViews and move them with B4XView.SetLayoutAnimated.

You will also need to uncheck the "handle resize event" option in the layout file properties.

Erel

B4X founder
Staff member
Licensed User
Longtime User
Why not add the buttons to a CustomListView? You can then add and remove items as needed.

The other option is to actually implement the layout changes you are talking about. Make sure that all buttons are declared as B4XViews and move them with B4XView.SetLayoutAnimated.

You will also need to uncheck the "handle resize event" option in the layout file properties.
 
Upvote 1
Solution
Why not add the buttons to a CustomListView? You can then add and remove items as needed.
How can i do that? I want some buttons to exist in my customlistview only if there are some keywords in a string that i pass from another module. The idea is:

MakeVisible:
Sub Make Visible(ArgFromOtherMod as string)

    If "keyword" in ArgFromOtherMod:

        show some of the buttons

    else if "other keyword" in ArgFromOtherMod:

         show some other buttons

    end if

end sub

Are there any guidelines for something like this (in booklet or somewhere else)??
 
Upvote 0
Top