LucaMs Expert Licensed User Longtime User May 24, 2025 #1 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 prova.zip 3.3 KB · Views: 320 caselle_lm.zip caselle_lm.zip 3.4 KB · Views: 295
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).
klaus Expert Licensed User Longtime User May 24, 2025 #2 He should uncheck Handle Resize Event in the casella2 layout in the Designer.
stevel05 Expert Licensed User Longtime User May 24, 2025 #3 We had part of this discussion yesterday: am I wrong or..? please, test this project i put 5 B4XFloatTextField into Pane from code, and is OK but resizing form, last B4XFloatTextField split at top am I wrong or..? (sorry for the bad english) www.b4x.com
We had part of this discussion yesterday: am I wrong or..? please, test this project i put 5 B4XFloatTextField into Pane from code, and is OK but resizing form, last B4XFloatTextField split at top am I wrong or..? (sorry for the bad english) www.b4x.com
LucaMs Expert Licensed User Longtime User May 24, 2025 #4 klaus said: He should uncheck Handle Resize Event in the casella2 layout in the Designer. View attachment 164289 Click to expand... Actually, that way the problem doesn't happen anymore, but I would say that it's not recommended to do it that way, since you might want other views to be automatically repositioned.
klaus said: He should uncheck Handle Resize Event in the casella2 layout in the Designer. View attachment 164289 Click to expand... Actually, that way the problem doesn't happen anymore, but I would say that it's not recommended to do it that way, since you might want other views to be automatically repositioned.
LucaMs Expert Licensed User Longtime User May 24, 2025 #5 stevel05 said: We had part of this discussion yesterday: am I wrong or..? please, test this project i put 5 B4XFloatTextField into Pane from code, and is OK but resizing form, last B4XFloatTextField split at top am I wrong or..? (sorry for the bad english) www.b4x.com Click to expand... I saw now; I would say: "duplicate thread"
stevel05 said: We had part of this discussion yesterday: am I wrong or..? please, test this project i put 5 B4XFloatTextField into Pane from code, and is OK but resizing form, last B4XFloatTextField split at top am I wrong or..? (sorry for the bad english) www.b4x.com Click to expand... I saw now; I would say: "duplicate thread"
stevel05 Expert Licensed User Longtime User May 24, 2025 #6 LucaMs said: I saw now; I would say: "duplicate thread" Click to expand... 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.
LucaMs said: I saw now; I would say: "duplicate thread" Click to expand... 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.