how to get android gradient center light effect?

前端 未结 5 1920
遥遥无期
遥遥无期 2021-02-01 14:09

i want something like following image

\"enter

i tried it using drawable shape

5条回答
  •  别那么骄傲
    2021-02-01 14:59

    The effect can be approximated in a Layer-List using multiple rectangular shapes. Use a solid rectangle with the center background color. Then use two gradients with the start and end colors the same. Make the center color the same also, except set the alpha to zero.

    In the code below the colors are as follows:

    @color/background_dark = #ffb8860b
    @color/background_light = #ffd2b48c
    @color/transparent = #00b8860b
    
    
    
        
            
                
            
        
    
        
            
                
            
        
    
        
            
                
            
        
    
    
    

提交回复
热议问题