Android的棒棒糖部分分离/除法 [英] Android Lollipop Sections Separator/Divider
问题描述
我试图像在Android的设置活动部分分隔符/除法创建表单。
I'm trying to create form with 'section separators/dividers' like in Android's Settings activity.
我倾倒视图层次视察活动,我注意到,分离只是某种绘渐变填充。只是有2 LinearLayouts(1,2),而且它们之间没有视图(3)。
I inspected the activity by dumping view hierarchy and I noticed that the separator is just some kind of padding with painted gradient. There are just 2 LinearLayouts (1,2) and there is no View between them (3).
是否有一个机器人的方式来画同样的分离?
我不希望创建临时的解决方案。
I don't want to create ad-hoc solutions.
推荐答案
棒棒糖带有高程值,这使得影子,看到的 https://developer.android.com/training/material/shadows-clipping.html 。如果要为pre-棒棒糖使得应用程序可以添加使用渐变背景有新的视图
Lollipop comes with elevation value which makes shadow, see https://developer.android.com/training/material/shadows-clipping.html. If you are making app for pre-lollipop you can add there new View with gradient background
这篇关于Android的棒棒糖部分分离/除法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!