How to highlight ImageView when focused or clicked?

前端 未结 10 1424
余生分开走
余生分开走 2020-12-02 08:34

A good example of this is either on the Twitter launch screen (the screen with the large icons that is seen when the application is first launch) or even just look at the ap

10条回答
  •  悲哀的现实
    2020-12-02 09:19

    You need to assign the src attribute of the ImageView a state list drawable. In other words, that state list would have a different image for selected, pressed, not selected, etc. - that's how the Twitter App does it.

    So if you had an ImageView:

    
    

    The src drawable (title_logo.xml) would look like this:

    
        
        
        
        
    
    

    The Google IO Schedule app has a good example of this.

提交回复
热议问题