Floating action button's shadow clipping at view margins

后端 未结 5 2162
没有蜡笔的小新
没有蜡笔的小新 2021-01-03 21:53

I have a floating action button anchored to the bottom right of a coordinator layout. It is 16dp from the margins of the view (the margins are included by default and specif

5条回答
  •  情话喂你
    2021-01-03 22:18

    I had the same issue for two ExtendedFloatingActionButton which were in a horizontal LinearLayout, so the two buttons could go next to one another. The grey shadow only appeared on the bottom two corners on the floating buttons but I had a bottom margin set on the linear layout so wasn't sure why there was clipping.

    I realised even though I had added android:clipChildren="false" to the LinearLayout my code was wrapped in a ConstraintLayout which meant the buttons were still be cut off.

    To solve this issue just add android:clipChildren="false" to the parent, which in my case was the ConstraintLayout.

    Example of my code:

    
                    
        
    
            
    
            
        
    
    

提交回复
热议问题