iOS Question Round button

stari

Active Member
Licensed User
hi, i can't find, how to make round Button in B4i, like in B4a -
cdwColor.Initialize(Colors.White ,50dip).
 

klaus

Expert
Licensed User
B4X:
Dim Button1 As Button
Button1.Initialize("Button1")
Activity.AddView(Button1, 50dip, 50dip, 100dip, 100dip)
Button1.Text="TEST1"
Dim cdw As ColorDrawable
cdw.Initialize2(Colors.Red, 50dip, 1dip, Colors.Black)
Button1.Background = cdw
 

stari

Active Member
Licensed User
B4X:
Dim Button1 As Button
Button1.Initialize("Button1")
Activity.AddView(Button1, 50dip, 50dip, 100dip, 100dip)
Button1.Text="TEST1"
Dim cdw As ColorDrawable
cdw.Initialize2(Colors.Red, 50dip, 1dip, Colors.Black)
Button1.Background = cdw
Thks very much.
 

stari

Active Member
Licensed User
B4X:
Dim Button1 As Button
Button1.Initialize("Button1")
Activity.AddView(Button1, 50dip, 50dip, 100dip, 100dip)
Button1.Text="TEST1"
Dim cdw As ColorDrawable
cdw.Initialize2(Colors.Red, 50dip, 1dip, Colors.Black)
Button1.Background = cdw
Ops, what library must i use for ColorDrawable in B4i ?? I can't find.
 

stari

Active Member
Licensed User
You don't need any library it's part of the core library.
Hello,
my B4i is version 1.80, iCore version 1.78 but for me "ColorDrawable" don't work. (Missing a library reference). I don't understand.
 

klaus

Expert
Licensed User
Sorry, I was thinking in B4A instead of B4i !
B4X:
Private Button1 As Button
Button1.InitializeCustom("Button1", Colors.Black, Colors.Blue)
Page1.RootPanel.AddView(Button1, 50, 50, 100, 100)
Button1.Color = Colors.Red
Button1.SetBorder(1, Colors.Black, 50)
 

stari

Active Member
Licensed User
Sorry, I was thinking in B4A instead of B4i !
B4X:
Private Button1 As Button
Button1.InitializeCustom("Button1", Colors.Black, Colors.Blue)
Page1.RootPanel.AddView(Button1, 50, 50, 100, 100)
Button1.Color = Colors.Red
Button1.SetBorder(1, Colors.Black, 50)
Tank you, klaus, all is workong OK. Have a nice weekend.
 
Top