iOS Question CustomListView bug?

Douglas Farias

Expert
Licensed User
Longtime User
Hi all, i m using on my app the CustomListView, this is working at first time but not later.
Here the results.


1º Time (First time i open this panel with CustomListView)
12080902_1038700536160162_756389866_n.jpg



2º Time, i close the panel, clear the CustomListView and add 2 itens again.
12071421_1038700529493496_1956769264_n.jpg




3° Time, i close the panel, clear the CustomListView and add 2 itens again.
12071364_1038700532826829_1247000322_n.jpg



The code used to add itens its this

I put this code under one loop(for each)
B4X:
listaeventos.Clear 'I CLEAR THE LIST FIRST
'FOR EACH  HERE
i = i + 1 'THIS TO MAKE A PANEL WHITE AND BLACK LATER
If i > 1 Then i = 0
Private p As Panel
p.Initialize("p")
If i = 0 Then
listaeventos.Add(p,13%y,ID)
p.LoadLayout("listapreta")
lbtitulolistapreta.Text = NAME
lbdatalistapreta.Text = data.SubString2(8,10)&"/"& data.SubString2(5,7)
Else
listaeventos.Add(p,13%y,ID)
p.LoadLayout("listabranca")
lbtitulolistabranca.Text = NAME
lbdatalistabranca.Text = data.SubString2(8,10)&"/"& data.SubString2(5,7)
Next

This code works fine on Android, same code but no bug.
Here on ios i got this error, sometimes i have same error when i use
panel.visible = false and later panel.visible = true, the same bug happens.

what can i make to fix this problem?
 

Douglas Farias

Expert
Licensed User
Longtime User
sory, but i dont understand erel, where i put this ? %x / %y
 
Upvote 0

Douglas Farias

Expert
Licensed User
Longtime User
i continue dont understand :(

i use only 1 page on my app, and 5 panels, when i want i put visible = true on the panels
the event Page1_Resize its fired only 1x when i open the app.

B4X:
Private Sub Page1_Resize(Width As Int, Height As Int)
    Log(Width)
    Log(Height)
End Sub

i add itens to customlistview in a for inside Sub JobDone (Job As HttpJob)
i really dont understand why this works first time and later bug o_O

its a bug only on customlistview, all another views are working fine

tryed
B4X:
    listaeventos.AsView.Top = 30%y
    listaeventos.AsView.Left = 5%x
    listaeventos.SetSize(90%x,64%y)

on Page1_Resize and the bug continue
 
Last edited:
Upvote 0

Douglas Farias

Expert
Licensed User
Longtime User
thx this works erel

B4X:
Sub Page1_Resize (Width As Float, Height As Float)
    panelsize = 13%y
End Sub

B4X:
            listaeventos.Add(p,panelsize,ID)
            p.LoadLayout("listabranca")
            lbtitulolistabranca.Text = NAME
            lbdatalistabranca.Text = data.SubString2(8,10)&"/"& data.SubString2(5,7)
 
Upvote 0
Top