Android Question ColorDrawable settings different in designer and code

Discussion in 'Android Questions' started by Albi, Jan 23, 2015.

Similar threads

B4A Code Snippet Scrollbar Color
B4A Tutorial StateListDrawable example
B4A Code Snippet Custom Toast Message
B4A Tutorial Android home screen widgets tutorial - part I
B4A Code Snippet SD: Spinner with CustomView
B4A Question Title color
  1. Albi

    Albi Active Member Licensed User

    Hello.

    I made a button in designer with the settings:
    corner radius = 10
    border width = 1

    I sometimes need to use the code to change it. I use the following code

    Code:
    Dim cdwLevel As ColorDrawable
    cdwLevel.Initialize2(
    Colors.Yellow,10,1,Colors.Black)
    however, these don't match! it seems thinner and with less of a radius when set in code than compared to the designer.

    how can i make these match?
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Change 10 to 10dip.
     
    Peter Simpson likes this.
  3. Albi

    Albi Active Member Licensed User

    thanks! I can't believe I made this mistake after reading so many times about not doing this.
     
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