Bug? Adding <custom view> at runtime-programmatically

LucaMs

Expert
Licensed User
Longtime User
The suggested way to add custom views programmatically is as follows:
https://www.b4x.com/android/forum/t...ew-here-s-how-to-add-programmatically.118037/

Yesterday an Italian member used that method in B4J and there is a problem: when the user resizes the form, the last added custom view automatically moves to an unwanted position (basically to the original position).

I'm attaching here the faulty project (prova.zip) and also an alternative solution (caselle_lm.zip; uses a support Pane in which to load the layout containing the custom view and then move the latter to the real destination Pane).
 

Attachments

  • prova.zip
    3.3 KB · Views: 21
  • caselle_lm.zip
    3.4 KB · Views: 25

stevel05

Expert
Licensed User
Longtime User
We had part of this discussion yesterday:
 

stevel05

Expert
Licensed User
Longtime User
I saw now; I would say: "duplicate thread"

From different posters, which is why I linked it here.

In my opinion I would say that this is not a bug. The custom view process was designed for the views to be added in a layout. If you choose to use them in a different way, you should expect to have to make changes and / or compromises. And it is then on the user to ensure that it works the way they want it to both now, and in the future if they change anything else in the app.
 
Top