在我的 NativeScript Angular 元素中,我试图将图像添加到我的背景中,但我一直收到错误消息
Value: Error: Response content may not be converted to an Image file
这是我的类所在的 html:
<GridLayout class="pageBackground">
<StackLayout class="main-container">
</StackLayout>
</GridLayout>
这是我的 .css 类所在的位置:
.pageBackground{
background-image: url('https://imgur.com/IjYwn5e');
background-repeat: no-repeat;
background-position: center;
background-size: cover;
}
最佳答案
在css中使用url作为图片时,url需要包含图片的文件类型。例如:https://imgur.com/IjYwn5e.jpg
关于html - NativeScript 图像不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51249409/