Tint / dim drawable on touch

前端 未结 8 1570
别跟我提以往
别跟我提以往 2021-01-31 11:24

The app I\'m currently working on uses a lot of ImageViews as buttons. The graphics on these buttons use the alpha channel to fade out the edges of the button and make them look

8条回答
  •  萌比男神i
    2021-01-31 11:43

    I think this solution is simple!

    Step 1: Create res/drawable/dim_image_view.xml

    
    
         
         
         
    
    

    Step 2: Create res/drawable/dim_image_view_normal.xml

    
    
        
    
    

    Step 3: Create res/drawable/dim_image_view_pressed.xml

    
    
        
    
    

    Step 4: Try setting the image in xml layout as:

    android:src="@drawable/dim_image_view"
    

提交回复
热议问题