I have attached a very small project sample just to prove the concept of loading 30 arrays of Customview
Questions:
1) Look at the codes - is this even the correct way of loading custom view by code / Is it an elegant way of loading a custom view
2) I cant raise event when customview button are clicked - What are the conflicts/limitations here?
3) Not too sure if customview is IOS compatible - Just curious
Your thread looks like it is crying for xCustomListView 's help. If you want to add customviews programmatically, below is the link, that will help you do it.
You need to stay away from scrollview. Your project is nice and demonstrates a great effort on your part, but, it does not add to what is available. You are trying to reinvent the wheel, but the wheel is already available and greased. If you need help, many of us in the forum can help you do what you are trying to do with an array of customviews like Swift Buttons on an xCLV.
Custom views are designed to be added with the designer. It is however very simple to create a layout file with the custom view and load it multiple times. Tip: remove the call to AutoScaleAll from the designer script. Complete example: Sub Globals Private B4XSwitch1 As B4XSwitch End...
I have applied your class customview to an xCustomListView. Please see attached project for the comparison between using a scrollview (your case) and an xClv (mahares}. Please note that the advantage of an xClv is your do not run out of scrolling space. I used 50 items. With the scrollview, you have to adjust it height every time, but not with xClv. The point I am making is that your class works with xClv. It can use more tweaking. Keep up the good work.