【问题标题】:Nativescript - setting background-image to noneNativescript - 将背景图像设置为无
【发布时间】:2017-10-17 16:19:20
【问题描述】:

有没有办法将 CSS background-image 属性设置为无或透明。

我正在使用 SASS 和主题,在某些主题中我有图像,而对于其他主题我没有 - 所以我想将其设置为无。

.my-class { background-image: $image; }

其中 $image 是一个 SASS 变量,可以设置为有效的 url 或无/透明。

顺便说一句,我确实将其设置为“无”,但出现以下错误

Error in downloadBitmap - java.net.MalformedURLException: Protocol not found: none

我认为 NS 正在尝试下载“无”位图。

【问题讨论】:

    标签: css sass nativescript


    【解决方案1】:

    将属性值设置为 null 似乎不包括该属性 - 有效。

    这是在 SASS 下。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-04-22
      • 1970-01-01
      • 2015-01-24
      • 2015-12-12
      相关资源
      最近更新 更多