Scroll view with buttons

spillo3d96

Member
Licensed User
Longtime User
Hello guys,
how can i add some buttons in a scroll view?
i try so :

Dim ScrollView1 As ScrollView
Dim Button1 As Button


Activity.LoadLayout("main")
ScrollView1.Initialize(0)
ScrollView1.Panel.AddView(Button1,50,20,50,50)


When i run the programm i get this error:
The specified child already has a parent. You must call remoteview() on the child's parent first

But both the views aren't parented with. :sign0085:
 

Roger Garstang

Well-Known Member
Licensed User
Longtime User
Sounds like you have a Button1 in your Designer Layout (Even if there was a Scrollview1 in there the initialize clobbers it, so it wouldn't have a parent). You are mixing and matching your Designer(LoadLayout) and handcoded layouts too since you have the scrollview initializing and the button not. If you are going to design anything I'd think it would be the scrollview then putting the button in by hand.
 
Last edited:
Upvote 0
Top