Custom Dialog with Scrollview

davelt99

Member
Licensed User
Longtime User
Hello,

I'm trying to add a scrollview to a customdialog2. The scrollview appears but it is empty even though I'm adding 3 labels to it. I must be missing something that should be obvious. Thanks for any help.
B4X:
Dim cd As CustomDialog2
Dim pnl As Panel 
Dim sv As ScrollView
sv.Initialize(0)
sv.Color=Colors.DarkGray
pnl.Initialize("")
pnl.Color=Colors.Blue
Dim lblTest(3) As Label

lblTest(0).Initialize("")
   lblTest(0).TextColor=Colors.White
   lblTest(0).Gravity=Gravity.Left + Gravity.CENTER_VERTICAL
   lblTest(0).Text="AAA"
   sv.Panel.AddView(lblTest(0),10dip,20dip,30dip,30dip)
lblTest(1).Initialize("")
   lblTest(1).TextColor=Colors.White
   lblTest(1).Gravity=Gravity.Left + Gravity.CENTER_VERTICAL
   lblTest(1).Text="BBB"
   sv.Panel.AddView(lblTest(1),10dip,60dip,30dip,30dip)
lblTest(2).Initialize("")
   lblTest(2).TextColor=Colors.White
   lblTest(2).Gravity=Gravity.Left + Gravity.CENTER_VERTICAL
   lblTest(2).Text="CCC"
   sv.Panel.AddView(lblTest(2),10dip,100dip,30dip,30dip)


pnl.AddView(sv,10dip,20dip,35%x,260dip)
cd.AddView(pnl,80%x,80%y)
ret=cd.Show("", "OK", "Cancel", "", Null)
 
Last edited by a moderator:
Top