B4J Question [ABMaterial] How to put the newly added component on top instead of bottom?

Hanz

Active Member
hello,

If we add a new component on a page or a container it is placed at the bottom. Is there a way to put it on top.

Example, if we do the following code:

B4X:
page.cell(1,1).AddComponent("component1")
page.cell(1,1).AddComponent("component2")

The above code results to:

Component1
Component2

Is there a way to reverse the effect: the newly added component, in this case component2 is on top as follows:

Component2
Component1

The objective is that, the newly added components, such as images w/ label, like posting is always on top and the old ones goes to the bottom.

Thanks.
 

Mashiane

Expert
Licensed User
Longtime User
@Hanz

Although I have never used, it, there seems to be a method called InsertComponentBefore for the cell component as depicted below. You pass it the component to add and the id of I guess the previous component that was added. I'm using ABM 4.25.

InsertComponentBefore.png


Good luck.
 
Upvote 0
Top