Alpha-gradient on Android

前端 未结 4 1026
梦谈多话
梦谈多话 2020-12-08 21:40

I need to create an alpha-gradient on the edge of the ImageView. Preferably using only XML.

Image for example

4条回答
  •  隐瞒了意图╮
    2020-12-08 21:47

    Here the solution

    the image look like below picture

    enter image description here

    code for that:

    • Prepare shape drawable

    res/drawable/gradient_shape.xml:

    
    
        
    
    

    Define layout: activity_main.xml:

    
    

    here drawable/photo is just jpeg in drawables folder

    EDIT for more information refer this Tutorial

提交回复
热议问题