create view over cardview in android

后端 未结 6 1613
后悔当初
后悔当初 2021-02-18 23:55

I want to create this layout

this is a cardview (gray view) and imageview(blue view) for that i use this code



        
6条回答
  •  暖寄归人
    2021-02-19 00:32

    The CardView has by default elevation in API 21+, you can manipulate the elevation to be less than that of the ImageView

        
    
     
    

    in Pre 21 you can use

    overlayView.bringToFront();
    root.requestLayout();
    root.invalidate();
    

    This will not work in 21+ if you have different elevation

提交回复
热议问题