如何在NativeScript中设置条纹样式背景

时间:2018-07-10 03:45:50

标签: android css nativescript

我想在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。背景尺寸和背景重复无效。 如果我想要条纹风格的背景该怎么办?

https://play.nativescript.org/?template=play-ng&id=7I1s1W

0 个答案:

没有答案