Android: Specify two different images for togglebutton using XML

前端 未结 1 634
粉色の甜心
粉色の甜心 2020-11-28 18:44

I\'m attempting to override the default ToggleButton appearance. Here\'s the XML that defines the ToggleButton:



        
1条回答
  •  猫巷女王i
    2020-11-28 19:08

    Your code is fine. However, the toggle button will display the first item in your selector that it matches, so the default should come last. Arrange the items in the following manner to ensure they will all be utilized:

    
         //currently pressed turning the toggle on
         //currently pressed turning the toggle off
         //not pressed default checked state
         //default non-pressed non-checked
    
    

    0 讨论(0)
提交回复
热议问题