1. Download our Official Android App: Forums for Android!

Apps Toggle Button Backgrounds

Discussion in 'Android Development' started by VTNotInCtrl, Jul 18, 2011.

  1. VTNotInCtrl

    VTNotInCtrl Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    8
    Joined:
    Jul 6, 2011

    Jul 6, 2011
    8
    0
    5
    I want a different background for on and off. Whats the best way to go about that?

    can i do in xml or do I need to do in java?:thinking:

    and what is the code i would add?
     

    Advertisement

  2. intentreceiver

    Rank:
    None
    Points:
    16
    Posts:
    15
    Joined:
    Jul 21, 2011

    Jul 21, 2011
    15
    1
    16
    ToggleButton inherits lots of useful stuff from android.view.View, including the method setBackgroundResource(int). I suggest you look into that.
     

Share This Page

Loading...