iOS Question Convert button creation from B4A to B4I

Giusy

Active Member
Licensed User
Hi, in B4A I create buttons programmatically with this code
B4X:
Dim x, y As Int
  For y = 0 To ROWs-1
   For x = 0 To columns - 1
    Dim bt As Button
    bt.Initialize("Button")                                                                    ERROR 1
    strLines =list1.get(y)
    bt.Text = strLines
    bt.Tag = y*columns
    bt.Typeface= Typeface.DEFAULT_BOLD                                         ERROR 2
    bt.TextSize=20                                                                           ERROR 3
    bt.SingleLine=True                                                                      ERROR 4
    bt.textcolor= Colors.RGB(0,0,128)                                                ERROR 5
    bt.Gravity = Bit.Or(Gravity.LEFT, Gravity.CENTER_VERTICAL)         ERROR 6

    ScreenScrollView.Panel.AddView(bt, x*BWidth,y*BHeight+2dip,BWidth,BHeight-4dip)  'Add Button
          
     Next
  Next

In B4I i get SIX error. :(
How can I replace incorrect instructions?

thanks to those who want to give me help :)
 
D

Deleted member 103

Guest
That's just a small example.
B4X:
    Dim btn As Button
    btn.Initialize("btn", btn.STYLE_SYSTEM)
    btn.CustomLabel.Font = Font.CreateNew(28)
    btn.Text = "Button"
 
Upvote 0

Giusy

Active Member
Licensed User
error 5 correct in bt.CustomLabel.TextColor= Colors.RGB(0,0,128)

error 2 - 4 - 6 not resolved
 
Upvote 0
Top