Nativescript background-image fullscreen

Pamungkas Jayuda picture Pamungkas Jayuda · Apr 8, 2016 · Viewed 19.9k times · Source

I want to create app in Nativescript with fullscreen image on page. I have to use background-image: url('~/images/background.jpg');. But how to make it full screen. Thanks for your help

Answer

Brad Martin picture Brad Martin · Apr 8, 2016

You need to use the NativeScript supported CSS properties to achieve this.

I've used the following CSS on a background-image attached to the <Page> view before and it works fine.

.coverImage {
    background-image: url('~/images/kiss.jpg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
}