In a lot of my apps I use a Scrollview and put views dynamically on it. Today I've found a strange behaviour (B4A 4.30). Maybe I'm blind, but...
In release mode the panel's height is adjusted correctly (tested on 2 devices), in debug (both modes), it will not change (stays at 1000dip). Any ideas?
later
In release mode the panel's height is adjusted correctly (tested on 2 devices), in debug (both modes), it will not change (stays at 1000dip). Any ideas?
B4X:
CMSsv.Initialize2(1000dip,"CMSsv")
Activity.AddView(CMSsv,0,0,100%x,100%y)
later
B4X:
toppos=1%y
For i = eArtikel To lArtikel
Artikel=ArtikelListe.get(i)
filen=Artikel.Get("ImageFile")
Dim ueb As Label
ueb.Initialize("")
ueb.Text=Artikel.Get("Ueberschrift")
ueb.Gravity=Gravity.CENTER
ueb.Color=Colors.DarkGray
ueb.TextColor=Colors.ARGB(255,255,165,0)
CMSsv.Panel.AddView(ueb,5%x,toppos,90%x,5%y)
SetLabelTextSize(ueb,ueb.Text)
toppos=toppos+5%y
Dim ueb2 As Label
ueb2.Initialize("")
ueb2.Text=Artikel.Get("OnlineAb") & " " & i & " (" & Artikel.Get("Autor") &")"
ueb2.Gravity=Gravity.left
ueb2.Color=Colors.DarkGray
ueb2.TextColor=Colors.ARGB(255,255,165,0)
CMSsv.Panel.AddView(ueb2,5%x,toppos,90%x,3%y)
SetLabelTextSize(ueb2,ueb2.Text)
toppos=toppos+4%y
Dim im As ImageView
im.Initialize("")
im.Bitmap=LoadBitmap(mypath ,filen)
im.Gravity=Gravity.CENTER
CMSsv.Panel.AddView(im,5%x,toppos,44%x,30%y)
Log(im.Width)
Log(im.height)
Dim te As Label
te.Initialize("")
te.Text=Artikel.Get("AText")
te.Color=Colors.DarkGray
te.TextColor=Colors.ARGB(255,255,165,0)
CMSsv.Panel.AddView(te,50%x,toppos,45%x,30%y)
SetLabelTextSize(te,te.Text)
toppos=toppos+32%y
Next
CMSsv.Panel.Height=toppos