Expo Linear Gradient transparent is showing up blackish

拜拜、爱过 提交于 2019-12-07 06:30:31

It's because transparent is equal to rgba(0,0,0,0)

Try using rgba(255,255,255,0) instead of transparent to get a white to white transition

The w3 spec defines transparent as transparent black as can be read here

I actually found my own answer. "transparent" apparently translates to black-transparent, to get white just specify an rgba() in the white channel like so:

<LinearGradient
    colors={[ 'rgba(255,255,255,0)', 'rgba(255,255,255,1)']}
    style={{
        position: 'absolute',
        left: 0,
        right: 0,
        bottom: 0,
        height: 80,
    }}
/>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!