html - 背景色改透明后卡住

标签 html css cordova ionic-framework ionic2

所以我正在使用插件 ( https://github.com/cordova-plugin-camera-preview/cordova-plugin-camera-preview ) 或 ( https://ionicframework.com/docs/native/camera-preview/ ) 为了显示它,我必须将背景颜色设置为透明,就像在 camera.scss 中一样:

    page-camera {

}
html, body, ion-app, ion-content, ion-page, .nav-decor{
   background-color: transparent !important;
}

但我遇到的一个问题是,当我关闭 cameraPreview 并弹出 View 时,我的背景卡在透明状态。

如何在使用相机插件时让我的背景只透明?

以下是部分截图: Background is white here

这张图片的背景是白色的 ^^ 正确 enter image description here

这张图片的背景是透明的^^正确 enter image description here 背景现在是透明的 ^^ 不正确

我没有在应用程序中使用其他 css,那么如何才能仅在一个摄像头屏幕上更改背景颜色?

谢谢

最佳答案

为什么不在页面相机内使用透明部分?

page-camera {
  html, body, ion-app, ion-content, ion-page, .nav-decor{
      background-color: transparent !important;
  }
}

所以它只影响那个页面。或者您必须在您的 home.component(如果有)中设置 background-color:initial

关于html - 背景色改透明后卡住,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47256169/

相关文章:

javascript - Jquery .empty() 前 2 个元素

javascript - 将相机捕获的图像转换为 base64 - Ionic

javascript - 背景图像

html - 为什么滚动条向左突出也不出现?

html - initial-scale=1 和 initial-scale=1.0 有区别吗?

html - 替换网站移动版本中的图标

火狐和 CSS3 : using overflow: hidden and box-shadow

html - 让子 div 适合其内容,而其父级有滚动条?

html - 什么 CSS 选择器根据属性值查找元素,而不考虑属性名称?

android - cordova 构建 android 在 Ubuntu 12.04 上抛出错误