iOS Question Unusual behavior in xCustomListView

Filippo

Expert
Licensed User
Longtime User
Hi,

since 2 days I'm trying to find the reason for this unusual behavior in xCustomListView, without success.
Now I uploaded a test project with the same error, hoping that someone will find the bug.

Error behavior:
In vertical alignment the xClv "clvParticipant" is filled with 4 items, but in horizontal alignment xCLv is empty.
How can this be?

1667478398273.png


1667478411650.png
 

Attachments

  • b4iExample.zip
    118.1 KB · Views: 44
Solution
All right, I solved the problem this way.
The last 3 lines may only be executed in vertical alignment.

Script-Genaral:
B4X:
'All variants script
AutoScaleAll

If ActivitySize > 6.5 Then
    ToolBar1.Height = 64dip
Else
    If Portrait Then
        ToolBar1.Height = 56dip
    Else
        ToolBar1.Height = 48dip
    End If
End If

pnlBackground.SetTopAndBottom(ToolBar1.Bottom, 100%y)

pnlStartInfo.Top = ToolBar1.Bottom + 5dip
pnlTimer.Top = pnlStartInfo.Bottom + 10dip
pnlHaeder.Top = pnlTimer.Bottom + 10dip
pnlControls.Top = pnlHaeder.Bottom + 1dip

If Portrait Then
    pnlParticipant.SetTopAndBottom(pnlControls.Bottom + 5dip, pnlButtons.Top - 5dip)
    clvParticipant.SetLeftAndRight(0, pnlParticipant.Width)...

Filippo

Expert
Licensed User
Longtime User
I have now made a few corrections.
message = "no problems found"
1667493828554.png


Now one item is missing
1667493910450.png


1667494003911.png


This is a part of the script, the xClv should be defined correctly, right?
B4X:
pnlParticipant.SetLeftAndRight(50%x + 5dip, 100%x - 10dip)
pnlParticipant.SetTopAndBottom(pnlHaeder.Top, pnlButtons.top - 5dip)

clvParticipant.SetLeftAndRight(0, pnlParticipant.Width)
clvParticipant.SetTopAndBottom(0, pnlParticipant.Height)
 
Upvote 0

Filippo

Expert
Licensed User
Longtime User
Hi Erel, a question: in what order are the designer script executed?
I ask because if I disable the last 2 lines in the script-genaral, then the horizontal alignment works correctly.
Of course, in this case the vertical alignment does not work correctly.

Script-Genaral:
B4X:
'All variants script
AutoScaleAll

If ActivitySize > 6.5 Then
    ToolBar1.Height = 64dip
Else
    If Portrait Then
        ToolBar1.Height = 56dip
    Else
        ToolBar1.Height = 48dip
    End If
End If

pnlBackground.SetTopAndBottom(ToolBar1.Bottom, 100%y)

pnlStartInfo.Top = ToolBar1.Bottom + 5dip
pnlTimer.Top = pnlStartInfo.Bottom + 10dip
pnlHaeder.Top = pnlTimer.Bottom + 10dip
pnlControls.Top = pnlHaeder.Bottom + 1dip

'pnlParticipant.SetTopAndBottom(pnlControls.Bottom + 5dip, pnlButtons.Top - 5dip)
'clvParticipant.SetTopAndBottom(0, pnlParticipant.Height)

Script-Variant:
B4X:
pnlStartInfo.Height = 100dip
pnlTimer.Height = 100dip

pnlStartInfo.Top = ToolBar1.Bottom + 5dip
pnlStartInfo.SetLeftAndRight(10dip, 50%x - 5dip)

pnlHaeder.Top = pnlStartInfo.Bottom + 5dip
pnlHaeder.SetLeftAndRight(10dip, 50%x - 5dip)

pnlControls.SetTopAndBottom(pnlHaeder.Bottom + 1dip, pnlButtons.Top - 5dip)
pnlControls.SetLeftAndRight(10dip, 50%x - 5dip)
clvControls.SetLeftAndRight(0, pnlControls.Width)
clvControls.SetTopAndBottom(0, pnlControls.Height)

pnlTimer.SetTopAndBottom(pnlStartInfo.Top, pnlStartInfo.Bottom)
pnlTimer.SetLeftAndRight(50%x + 5dip, 100%x - 10dip)

pnlParticipant.SetLeftAndRight(50%x + 5dip, 100%x - 10dip)
pnlParticipant.SetTopAndBottom(pnlHaeder.Top, pnlButtons.top - 5dip)

clvParticipant.SetLeftAndRight(0, pnlParticipant.Width)
clvParticipant.SetTopAndBottom(0, pnlParticipant.Height)
 
Upvote 0

Filippo

Expert
Licensed User
Longtime User
All right, I solved the problem this way.
The last 3 lines may only be executed in vertical alignment.

Script-Genaral:
B4X:
'All variants script
AutoScaleAll

If ActivitySize > 6.5 Then
    ToolBar1.Height = 64dip
Else
    If Portrait Then
        ToolBar1.Height = 56dip
    Else
        ToolBar1.Height = 48dip
    End If
End If

pnlBackground.SetTopAndBottom(ToolBar1.Bottom, 100%y)

pnlStartInfo.Top = ToolBar1.Bottom + 5dip
pnlTimer.Top = pnlStartInfo.Bottom + 10dip
pnlHaeder.Top = pnlTimer.Bottom + 10dip
pnlControls.Top = pnlHaeder.Bottom + 1dip

If Portrait Then
    pnlParticipant.SetTopAndBottom(pnlControls.Bottom + 5dip, pnlButtons.Top - 5dip)
    clvParticipant.SetLeftAndRight(0, pnlParticipant.Width)
    clvParticipant.SetTopAndBottom(0, pnlParticipant.Height)
End If
 
Upvote 0
Solution
Top