How to create button Dynamically with three columns and five rows ???
Sub Process_Globals
Type Pos(x As Int,y As Int)
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Test")
Buttons
Sub Buttons
For x = 0 To 2
For y = 0 To 4
Dim ButtonX As Button
Dim PosX As Pos
PosX.x = x
PosX.y = y
ButtonX.Initialize("Button")
ButtonX.Tag = PosX
Activity.AddView(ButtonX,x*33%x,y*20%y,33%x,20%y)
Next
Next
End Sub
Sub Button_Click
Dim Button1 As Button
Button1 = Sender
Dim Pos1 As Pos
Pos1 = Button1.Tag
Log(Pos1.x & " " & Pos1.y)
End Sub
Add a Scrollview and the buttons to the Scrollview's panel and set the height.if Y value is Dynamic,then how to calculate %x and %y ???
I means,It should be scrollable if rows is greater than 15.........
then u use dip as size, it will have at all devices the same height.if Y value is Dynamic,then how to calculate %x and %y ???
y*100dip