iOS Question Strange effect with tableview

Alessandra Pellegri

Active Member
Licensed User
Longtime User
At the start Panel3 is not visible (from UI designer)

If I do:
B4X:
Sub Process_Globals
...
...
  Private ListView6 As TableView
...
end sub

Private Sub Application_Start (Nav As NavigationController)
  ListView6.Initialize("ListView6", False)
  Panel3.AddView(ListView6, 0, 0, 100%x, 100%y)
end Sub
...
...
during resize:

  Panel3.Width=Panel1.Width   'Addizionali
     Label2.Top=0
     Label2.Left=0
     Label2.Width=Panel3.Width
       ListView6.AddSingleLine("rrrrrrrrrr")
       ListView6.AddSingleLine("aaaaa")
       ListView6.AddSingleLine("fffffffff")
     ListView6.Left=0
     ListView6.Top=Label2.Height
     ListView6.Width=Panel3.Width
     ListView6.Height=Panel3.Height

When I set Panel3.Visible = true and Panel3.Bringtofront I correctly see:
B4X:
   rrrrrrrrrr
   aaaaa
   fffffffff

If I do:
B4X:
  Panel3.Width=Panel1.Width   'Addizionali
     Label2.Top=0
     Label2.Left=0
     Label2.Width=Panel3.Width
     ListView6.Left=0
     ListView6.Top=Label2.Height
       ListView6.AddSingleLine("rrrrrrrrrr")
       ListView6.AddSingleLine("aaaaa")
       ListView6.AddSingleLine("fffffffff")
     ListView6.Width=Panel3.Width
     ListView6.Height=Panel3.Height

I still have correct result. But I f I do:
B4X:
  Panel3.Width=Panel1.Width   'Addizionali
     Label2.Top=0
     Label2.Left=0
     Label2.Width=Panel3.Width
     ListView6.Left=0
     ListView6.Top=Label2.Height
     ListView6.Width=Panel3.Width
       ListView6.AddSingleLine("rrrrrrrrrr")
       ListView6.AddSingleLine("aaaaa")
       ListView6.AddSingleLine("fffffffff")
     ListView6.Height=Panel3.Height

Listview6 remain empty. What could be ?

Thank you
 

Alessandra Pellegri

Active Member
Licensed User
Longtime User
I simplified at maximum the problem creating the attached basic project.

You can simply try (not working):
B4X:
Private Sub Page1_Resize(Width As Int, Height As Int)
     ListView6.Left=0
     ListView6.Top=Label2.Height
     ListView6.Width=Panel3.Width
     ListView6.Height=Panel3.Height
     ListView6.AddSingleLine("rrrrrrrrrrrrrr")
End Sub

or this (works):

B4X:
Private Sub Page1_Resize(Width As Int, Height As Int)
     ListView6.AddSingleLine("rrrrrrrrrrrrrr")
     ListView6.Left=0
     ListView6.Top=Label2.Height
     ListView6.Width=Panel3.Width
     ListView6.Height=Panel3.Height
End Sub
 

Attachments

  • TableViewProblem.zip
    2.1 KB · Views: 181
Upvote 0

Derek Johnson

Active Member
Licensed User
Longtime User
Add this at the end:

ListView6.Reloadall

otherwise it looks like your changes may not be displayed until you rotate the device.
 
Upvote 0
Top