I recently added a linear-gradient to an image in my NativeScript 8 app. Surprisingly, it seems to work perfectly on iOS, but I'm encountering some issues on Android. Despite trying solutions like using -webkit-linear-gradient()
, the desired effect is still not achieved.
Here is how I implemented it:
HTML
<GridLayout rows="auto, auto, auto, auto, auto">
<image class="backgroundImage" src="~/assets/images/registration.png"></image>
...
...
...
</GridLayout>
CSS
.backgroundImage {
background: -webkit-linear-gradient(bottom, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 85%);
background: linear-gradient(to bottom, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 85%);
width: 100%;
}
iOS Emulator Screenshot (expected result)
https://i.sstatic.net/lXSY7.png
Android Emulator Screenshot (gradient issue)
https://i.sstatic.net/vpJEV.png
My question is: What could be causing this difference in behavior between iOS and Android with my current implementation?