selector is not working

后端 未结 2 1782
后悔当初
后悔当初 2021-01-21 19:15

I uses its selection for the list




        
2条回答
  •  后悔当初
    2021-01-21 19:59

    a selector is a 'state-list-drawable', ie it 'selects' depending upon the state of the view it is applied to.

    A StateListDrawable is a drawable object defined in XML that uses a several different images to represent the same graphic, depending on the state of the object. For example, a Button widget can exist in one of several different states (pressed, focused, or niether) and, using a state list drawable, you can provide a different background image for each state.

    Here is the syntax, as in the docs :

    
        
    
    

    notice the attributes you can set in the the .

    here is an example of a typical selector..

    
        
          
          
          
    
    

提交回复
热议问题