I needed one hour to find out, what is the reason for a strange behavior in my code. Now I think I can prove that this is a bug:
I use the Scrollview to offer a variing number of objects. Of course the Innerheight() of the Scrollview should exactly fit the object. So I change ScrollView.Panel.Height after adding or removing objects. But the Innerheight is not updates and keep as it was before. Sometimes bigger as needed, sometimes to small.
This is a minimal example that shows the behavior:
The first pressing of the button will work. You see the Scrollview shrinking to 600 and, depending on the button you pressed, the Innerheight() will change to 1000 or 3000. But... nothing happens with Innerheight() after pressing the second button.
If you change the code to....
...everything will work as expected. That shows, that the changing of the Innerheight() does not start a updating of the view. But if a parameter of theScrollView changes (... or any parameter of one of the inner objects) also the Innerheight will be updates.
I use the Scrollview to offer a variing number of objects. Of course the Innerheight() of the Scrollview should exactly fit the object. So I change ScrollView.Panel.Height after adding or removing objects. But the Innerheight is not updates and keep as it was before. Sometimes bigger as needed, sometimes to small.
This is a minimal example that shows the behavior:
B4X:
Sub Globals
Private Button1,Button2 As Button
Private ScrollView1 As ScrollView
Private Labels(15) As Label
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("layout1")
ScrollView1.Panel.Color=Colors.Red
For i=0 To 14
Labels(i).Initialize("press")
Labels(i).Color=Colors.Gray
ScrollView1.Panel.AddView(Labels(i),0,50dip*i,200dip,45dip)
Next
End Sub
Sub Button1_Click
ScrollView1.Panel.Height=1000
ScrollView1.Height=600
Log("click smaller")
End Sub
Sub Button2_Click
ScrollView1.Panel.Height=3000
ScrollView1.Height=600
Log("click bigger")
End Sub
The first pressing of the button will work. You see the Scrollview shrinking to 600 and, depending on the button you pressed, the Innerheight() will change to 1000 or 3000. But... nothing happens with Innerheight() after pressing the second button.
If you change the code to....
B4X:
Sub Button1_Click
ScrollView1.Panel.Height=1000
ScrollView1.Height=601 '<------also change something else
Log("click smaller")
End Sub
Sub Button2_Click
ScrollView1.Panel.Height=3000
ScrollView1.Height=599 '<------also change something else
Log("click bigger")
End Sub
...everything will work as expected. That shows, that the changing of the Innerheight() does not start a updating of the view. But if a parameter of theScrollView changes (... or any parameter of one of the inner objects) also the Innerheight will be updates.