iOS Question [SOLVED] Different layout results between Release and Debug

Star-Dust

Expert
Licensed User
Longtime User
I made a grid of images inside a panel (the one in gray). This panel is located inside the white one.

In the desktop version it appears correctly. because the gray panel is in the Top,Left position (0,0)
In the Debug version, the gray panel despite having the Top,Left position (0,0), appears at the bottom. Why?

---------- RELEASE -------------------------- DEBUG ----------
IMG_0132.PNG
--
IMG_0133.PNG


I add that I have 4 B4XCombo, which in the release version correctly appear with CENTER adjustment. In the debug version they are adjusted as RIGHT
 

Star-Dust

Expert
Licensed User
Longtime User
Moved to the questions forum.

Make your life simpler and use xCustomListView for this and build the layout with the designer.

As you haven't posted any information I can only guess that you are not dealing with page resizes correctly.
Thanks for the advice, but in my opinion xCustomListView would complicate my life for the particular view I make.

Actually you're right the mistake is simply in resizing. In fact, it does not occur in the Android version.
But the strange thing is that it should be realized in B4i in the Release version, instead the view is different. Although there was an error in the resize, it never presented the error in debug or release. To date (I have been working on it for 10 days) but only one debug.

It seems to me an oddity and I thought it was a bugs. I thought it could be useful.
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
There are mistakes, such as using %x outside of the Page_Resize event, that may not cause problems based on timing of other events.
Thanks for the reply. But it doesn't explain why the comboBox has the same error.
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
The only thing that I can say is:

As you haven't posted any information I can only guess that you are not dealing with page resizes correctly.
Yes, sorry I was so focused on the problem that I had forgotten.

As I wrote, in the meantime I solved the error it was in scaling.

I noticed an error in the calculation of the scaling, but it did not solve the thing. Then based on what you told me, the timing, I added a Sleep (50) and now it works properly.
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
SOLUTION
I return to the subject to give some more information. Why since this morning that I go crazy behind this thing.

So I wanted to understand the problem well. Even using sleep every now and then in the debug version the problem occurred again in the B4XComboBoxes.
The resize is correct and therefore it had to be something else. I used the method I was taught in school to find bugs. Start removing pieces of code and sectors and follow the debugging step by step.

Here is the reason for the defect:

I anchored 3 panels in my CustomView this way:
B4X:
mBase.LoadLayout("Panel1")
mBase.LoadLayout("Panel2")
mBase.LoadLayout("Panel3")

As soon as I put the three panels into a single Layout, the problem did not arise again.
B4X:
mBase.LoadLayout("AllPanel")

The same problem I had in the other CustomView, with this change all my customview have settled.
I hope to be useful to someone else who will face a similar problem.

PS. This problem doesn't show up on Android. So for me it is a BUGS even though the thread has been moved from the BUGS section
 
Last edited:
Upvote 0
Top