html - NativeScript 图像不工作

标签 html css angular nativescript

在我的 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/

相关文章:

html - 可靠地使用 hammer.js 获取平移事件,同时仍然在 iOS 中自然滚动......?

css - CSS "selectors"之间的那个东西叫什么?

html - 如何在 Angular Material 卡中使用图片元素

javascript - 多个表行作为单个组件

css - 使用 css 或 xpath 需要代码下方的 selenium 代码

angular - ngForm 和 FormGroup 的区别

html - 当 flex 元素在 column-reverse 时应用 nth-child()

javascript - 添加后清空 <li> 标签

javascript - 在阿拉伯字符串上使用替换时的奇怪行为

javascript - 发布窗口调整大小事件,但在页面对用户可见之前?