全屏原生脚本背景图像
问题描述:
我想在Nativescript页面上使用全屏图像创建应用程序.我必须使用background-image: url('~/images/background.jpg');
.但是如何使其全屏显示.
谢谢您的帮助
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
答
You need to use the NativeScript supported CSS properties to achieve this.
我以前在附加到<Page>
视图的背景图像上使用了以下CSS,并且效果很好.
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;
}