I have copied my code from b4a for taking eight name labels (defined in the designer as four labels on top of four other labels) and moving them into a scrollview so the list of eight names scrolls with a smaller area than needed for eight.
I converted RemoveView to RemoveViewFromParent
ContentHeight is defined as twice scrollNames.Height in the designer.
In debug I can see the labels being created in the correct places, but once the screen has drawn I get to see just four labels in the centre of the scrollView ?!?!?
Any ideas?
I converted RemoveView to RemoveViewFromParent
B4X:
lblName1.RemoveViewFromParent
lblName2.RemoveViewFromParent
lblName3.RemoveViewFromParent
lblName4.RemoveViewFromParent
lblName5.RemoveViewFromParent
lblName6.RemoveViewFromParent
lblName7.RemoveViewFromParent
lblName8.RemoveViewFromParent
scrollNames.Panel.AddView(lblName1, lblName1.Left, lblName1.Top - scrollNames.Top, lblName1.Width, lblName1.Height)
scrollNames.Panel.AddView(lblName2, lblName2.Left, lblName2.Top - scrollNames.Top, lblName2.Width, lblName2.Height)
scrollNames.Panel.AddView(lblName3, lblName3.Left, lblName3.Top - scrollNames.Top, lblName3.Width, lblName3.Height)
scrollNames.Panel.AddView(lblName4, lblName4.Left, lblName4.Top - scrollNames.Top, lblName4.Width, lblName4.Height)
scrollNames.Panel.AddView(lblName5, lblName5.Left, lblName5.Top - scrollNames.Top + scrollNames.Height, lblName5.Width, lblName5.Height)
scrollNames.Panel.AddView(lblName6, lblName6.Left, lblName6.Top - scrollNames.Top + scrollNames.Height, lblName6.Width, lblName6.Height)
scrollNames.Panel.AddView(lblName7, lblName7.Left, lblName7.Top - scrollNames.Top + scrollNames.Height, lblName7.Width, lblName7.Height)
scrollNames.Panel.AddView(lblName8, lblName8.Left, lblName8.Top - scrollNames.Top + scrollNames.Height, lblName8.Width, lblName8.Height)
In debug I can see the labels being created in the correct places, but once the screen has drawn I get to see just four labels in the centre of the scrollView ?!?!?
Any ideas?
Last edited: