I am looking for a way of adding 10 buttons to a panel programmatically. Each of these buttons when clicked will have its own functionality. Is it possible to do this without using the AHDashboard library?
I have been doing it as below but this process is not efficient if i want, say 20 buttons.
I have been doing it as below but this process is not efficient if i want, say 20 buttons.
B4X:
btn1.Initialize("Button1")
btn1.Text="Button1"
btn2.Initialize("Button2")
btn2.Text="Button2"
btn3.Initialize("Button3")
btn3.Text="Button3"
btn4.Initialize("Button4")
btn4.Text="Button4"
pnl1.Initialize("")
pnl1.Color=Colors.Transparent
pnl1.AddView(btn1,25%x-50dip,20%y,100dip,100dip)
pnl1.AddView(btn2,75%x-50dip,20%y,100dip,100dip)
pnl1.AddView(btn3,25%x-50dip,60%y,100dip,100dip)
pnl1.AddView(btn4,75%x-50dip,60%y,100dip,100dip)
Activity.AddView(pnl1,0dip,0dip,100%x,100%y)