I have a strange problem.
I start a page pressing the button "SERVIZIO" (foto 1)
Now I have a tableview with 4 choice (foto 2)
The tableview is on a panel and log says:
TableViewServizi.Width 320
TableViewServizi.Height 480
serviziPNpanel1.Width 320 (this is the panel with the tableview)
Then I press "MANUTENZIONE" and I return on the prior page (foto 3)
Finally I press again "SERVIZIO" and I have foto 4
Tableview is resized and text does not enter on the line
Log says:
TableViewServizi.Width 128
TableViewServizi.Height 128
serviziPNpanel1.Width 320
I create tableview with this code....
Where is my mistake?
Thanks
Marco
I start a page pressing the button "SERVIZIO" (foto 1)
Now I have a tableview with 4 choice (foto 2)
The tableview is on a panel and log says:
TableViewServizi.Width 320
TableViewServizi.Height 480
serviziPNpanel1.Width 320 (this is the panel with the tableview)
Then I press "MANUTENZIONE" and I return on the prior page (foto 3)
Finally I press again "SERVIZIO" and I have foto 4
Tableview is resized and text does not enter on the line
Log says:
TableViewServizi.Width 128
TableViewServizi.Height 128
serviziPNpanel1.Width 320
I create tableview with this code....
B4X:
Sub SelezionaServizio
TableViewServizi.Initialize("TableViewServizi", False)
TableViewServizi.Color=Colors.Transparent
serviziPNpanel1.AddView(TableViewServizi, 0, 0, 100%x, 100%y)
contarighe = 0
waitForAnimation.Initialize("waitForAnimation", 500)
waitForAnimation.Enabled = True
End Sub
Sub waitForAnimation_tick
waitForAnimation.Enabled = False
For i = 0 To Main.rows.size - 1
Dim m As Map
m = Main.rows.Get(i)
TableViewServizi.RowHeight = 50 'must set RowHeight before adding custom views.
Log("TableViewServizi.Width " & TableViewServizi.Width)
Log("TableViewServizi.Height " & TableViewServizi.Height)
Log("serviziPNpanel1.Width " & serviziPNpanel1.Width)
Dim tc1 As TableCell = TableViewServizi.AddSingleLine("")
tc1.ShowSelection = False
tc1.CustomView = CreateItemSer
Dim name As String = m.Get("t14ambitidescrizione")
comamb = m.Get("t14ambiticodice")
lbTSer.Text=name
lbTSerCod.Text=comamb
btTSer.BringToFront
contarighe=contarighe+1
Next
Main.NavControl.ShowPage(PageX)
If contarighe=0 Then
Messaggio="Nessuna Struttura selezionata"
Msgbox2("Msg",Messaggio,Main.TitoloMsg,Array("OK"))
End If
End Sub
Private Sub CreateItemSer As Panel
Dim p As Panel
p.Initialize("")
p.Width = 100%x
p.Height = TableViewServizi.RowHeight
p.LoadLayout("tser")
p.Color=Colors.Transparent
Return p
End Sub
Where is my mistake?
Thanks
Marco