I was working with animations recently, and got into trouble, when FrameLayout
did not show its shadow properly due to weird reasons.
I found a good answer, which helped me, but there was used a property called clipToPadding
. Answer can be found here: Android “elevation” not showing a shadow
However, I really wanted to understand the purpose of this property. I went to documentation of Android, which states that:
Defines whether the ViewGroup will clip its children and resize (but not clip) any EdgeEffect to its padding, if padding is not zero. This property is set to true by default.
I have read it for many times and I looked for examples on the web, but I really failed to find some. The only visuals I found was similar to this ClipToPadding difference
I can see the effect on the list, but how can it affect, when there is only one View
in the ViewGroup
for example etc.
It would be nice if someone could provide me a few key points about this property and how it works with a few examples.
clipToPadding=true
, the parent will clip off its children as if the padded portion hides a portion the child under it. I don't know if I'm making much sense to you... :/