Android Question Button Borders

Discussion in 'Android Questions' started by Paul Boyle, Apr 29, 2015.

  1. Paul Boyle

    Paul Boyle Member Licensed User

    Hi

    Is it possible, via code, to add a border to a button when EnabledDrawable = GradientDrawable ?

    Thanks

    P
     
  2. Peter Simpson

    Peter Simpson Expert Licensed User

  3. Paul Boyle

    Paul Boyle Member Licensed User

    Hi

    Why wont the below work?

    Item pressed on a ListView:

    Code:
    sub lv_Theme_ItemClick (Position as int, Value as object)
         
    Select Case Value
              
    Case "Light"
                    UpdateTheme(
    Colors.White)
              
    Case "Dark"
                    UpdateTheme(
    Colors.Black)
         
    End Select
    Called Sub:

    Code:
    Sub UpdateTheme(color1 as ColorDrawable)

           pnl_Home.Background = color1

    End Sub
    Many Thanks

    P.
     
  4. eurojam

    eurojam Well-Known Member Licensed User

    your sub Updatetheme needs a ColorDrawable as parameter, but you are passing a color, so change the argument to a colordrawable:
    Code:
    Dim cd As ColorDrawable
    cd.Initialize(
    Colors.Green, 5dip)
    UpdateTheme(cd)
     
    Bobi, Paul Boyle and DonManfred like 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