iOS Question [B4X] Panel inside CLV does not resize

CryoGenID

Active Member
Licensed User
Longtime User
Hello fellow developers,

I have a question and really hope that you can help me :)

In my B4X application I have a CLV (CustomListView) and inside it I have several panels.
What I am trying to do is to resize (change the height) of the panels during runtime.
Therefore I am going through all views in the CLV and look for the panels tag.

B4X:
If v.Tag.As(String).Contains("panel__PP__orgData") Then
                ' We have found the correct panel, the panel "panel__PP__orgData"
                Dim temp__panel__PP__orgData As Panel = v
                temp__panel__PP__orgData.Height = 800
                temp__panel__PP__orgData.Color = xui.Color_Blue ' Debug test
            End If

This code is working for the coloring part: the panel gets Magenta....
But it is not being resized.... If I debug the value of "temp__panel__PP__orgData.Height" at the end of the code seen above, it is indeed 800 (px)... But the UI itself doesn't reflect the change..

--> How can I make the panel "really" resize also in the UI?

Thanks so much for any pointers how to get this working :)

Best regards,

Chris
 
Last edited:
Solution
The solution is simple :)

Just uncheck the "Handle Resize Event" checkbox in the "Seach__Generic" form.
You should do this in all layouts you add to a list.

Now that was a problem, no one would have thought of that if you had not had an example project ;)

1653163923925.png

CryoGenID

Active Member
Licensed User
Longtime User
Hello Alexander,

thanks for your quick reply :)
Yes the CLV has still a lot of space/height, I can scroll way down (where there is currently just emptiness ;-) )...

Here is a screenshot:
1652973152436.png


The gray area is the CLV, so there is still a lot of free room below it...

And I have also tried to make the panel less high, doesn't work either :-(

Thanks and best regards,

Chris
 
Last edited:
Upvote 0

CryoGenID

Active Member
Licensed User
Longtime User
Update:
In the CLV has one layout loaded.
That layout has several panels, two of which you can see on the screenshot above...
These panels are not inside each other but both on the "root" level of the layout.
 
Upvote 0

CryoGenID

Active Member
Licensed User
Longtime User
Does anybody have any more ideas?
I really need to resize these panels :-/

Thanks so much,
best regards,

Chris
 
Upvote 0

CryoGenID

Active Member
Licensed User
Longtime User
Yes I know but that is a lot (!) of work to strip it down to exactly that problem as everything is dynamically loaded etc.

So I hoped (and still hope) that somebody (perhaps @Erel) has an idea what could be the problem for a panel inside a CLV to resize in its settings but not being reflected visually...
 
Upvote 0

Alexander Stolte

Expert
Licensed User
Longtime User
  1. Add a Item with Panels to the CLV
  2. Try to Resize the Panel
  3. Look if it works or not
But as an outsider, there is absolutely no way to understand what you are doing, so there is no way to tell what you are doing wrong.
 
Upvote 0

Hamied Abou Hulaikah

Well-Known Member
Licensed User
Longtime User
The shortest way is making in designer a different items panels "as your panel__PP__orgData" with different heights, then call & load it inside your above code & set the height size for clv row height.
Note your code above resize height for clv row only not for panel inside it.
 
Upvote 0

CryoGenID

Active Member
Licensed User
Longtime User
Thanks for all your replies :)

I have now created a really stripped down version of the app, so please ignore all the labels which are not nice etc ;-)
This is just the B4i-Version (the whole app is B4X)
In B4J, the panes change their height correclty, but in B4i it is not working with the panels :-(

In this demo, I have a panel with two buttons (they have no function!)... And if the resizing works correctly, both buttons should be visible... Also I have logged the change of the height of the pane in the log window...

Hopefully you can help me out :)

Thanks and best regards,

Chris
 

Attachments

  • ErrorDemo1.zip
    174.3 KB · Views: 154
Upvote 0

Alexander Stolte

Expert
Licensed User
Longtime User
The solution is simple :)

Just uncheck the "Handle Resize Event" checkbox in the "Seach__Generic" form.
You should do this in all layouts you add to a list.

Now that was a problem, no one would have thought of that if you had not had an example project ;)

1653163923925.png
 
Upvote 0
Solution

CryoGenID

Active Member
Licensed User
Longtime User
Thanks so much Alexander!

Do you also have a trick up your sleeve how to best organize (arrange) all the panels that I have programmatically?
The "Handle Resize Event" did that perfectly before (besides the real height adjustment of the one panel)...
Currently I am trying to iterate through all the views (panels), note their position, then iterate again and change the "top" value (all that happens inside the "asChips_heightChanged" event)... But that is not that optimal...
Is there an easier way of accessing the views (panels in my case) of the current CLV content than by always iterating over all elements and checking the type and tag to find the correct panel?

Thanks again :)
 
Upvote 0

Alexander Stolte

Expert
Licensed User
Longtime User
No there is not, unless you know the index of the respective panels. or if you add the layout only 1 time to the list, you can also define the panels in the "Class_Globals", but that works only if the layout was added 1 time in the same class.
 
Upvote 0
Top