iOS Question Round button

Discussion in 'iOS Questions' started by stari, Jan 29, 2015.

  1. stari

    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).
     
  2. ciginfo

    ciginfo Active Member Licensed User

    With Corner radius Property in th designer
     
  3. klaus

    klaus Expert Licensed User

    Set the Width and Height properties to the same value and the corner radius to the half of that value.
     
    stari likes this.
  4. stari

    stari Active Member Licensed User

    thks, klaus. And with the code ? Ah, can i achive this with SetBorder ?
     
  5. klaus

    klaus Expert Licensed User

    Code:
    Dim Button1 As Button
    Button1.Initialize(
    "Button1")
    Activity.AddView(Button1, 50dip50dip100dip100dip)
    Button1.Text=
    "TEST1"
    Dim cdw As ColorDrawable
    cdw.Initialize2(
    Colors.Red, 50dip1dipColors.Black)
    Button1.Background = cdw
     
    stari likes this.
  6. stari

    stari Active Member Licensed User

    Thks very much.
     
  7. stari

    stari Active Member Licensed User

    Ops, what library must i use for ColorDrawable in B4i ?? I can't find.
     
  8. klaus

    klaus Expert Licensed User

    You don't need any library it's part of the core library.
     
    stari likes this.
  9. stari

    stari Active Member Licensed User

    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.
     
  10. klaus

    klaus Expert Licensed User

    Sorry, I was thinking in B4A instead of B4i !
    Code:
    Private Button1 As Button
    Button1.InitializeCustom(
    "Button1"Colors.Black, Colors.Blue)
    Page1.RootPanel.AddView(Button1, 
    5050100100)
    Button1.Color = 
    Colors.Red
    Button1.SetBorder(
    1Colors.Black, 50)
     
    stari likes this.
  11. stari

    stari Active Member Licensed User

    Tank you, klaus, all is workong OK. Have a nice weekend.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice