Lollipop Partition Separator / Separator

I am trying to create a form with section separators / separators, for example in the Android Settings.

enter image description here

I checked the activity by dropping the view hierarchy, and I noticed that the separator is just some kind of padding with a drawn gradient. There are only 2 LinearLayouts (1,2), and there is no view between them (3).

enter image description here

Is there an β€œAndroid” way to draw the same separator?

I do not want to create ad-hoc solutions.

+4
source share
1 answer

Lollipop has a height value that the shadow makes, see https://developer.android.com/training/material/shadows-clipping.html . If you are making an application for pre-lollipop, you can add a new view with a gradient background

+2
source

Source: https://habr.com/ru/post/1242312/


All Articles