我想在nativescript中绘制带有条纹样式背景的列,并注意到从nativescript4.0开始支持线性渐变。 所以我尝试在android上执行以下代码:
html:
<StackLayout class="equalizer" height="200"></StackLayout>
css:
.equalizer {
width:24;
background: linear-gradient(to top, white 50%, black);
background-size:100% 40;
background-repeat: repeat-y;
border: solid black;
border-width: 1
}
实际上,背景会扩展到整个StackLayout。背景尺寸和背景重复无效。 如果我想要条纹风格的背景该怎么办?