You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/08/15 16:27:24 UTC

[GitHub] [cordova-plugin-statusbar] breautek commented on issue #149: Problems with transparency on custom background color

breautek commented on issue #149: Problems with transparency on custom background color
URL: https://github.com/apache/cordova-plugin-statusbar/issues/149#issuecomment-521705573
 
 
   What you are trying to do is a conflict. Overlay statusbars must be transparent. They are not solid and cannot have a color applied to them. Therefore by calling `backgroundColorByHexString` afterwards, the native code must remove the translucent flags required to make it an overlay, so the statusbar becomes a solid again so that a color can be applied.
   
   If you want an overlayed statusbar but still want to apply a background color to it, I'd suggest creating and positioning an HTML div with the desired color. I'll provide a sample css.
   
   ```css
   .myStatusBarDiv {
       position: fixed;
       top: 0px;
       left: 0px;
       right: 0px;
    /* In my experience, 20px covers all modern phones, but not 100% if this is a safe assumption */
       height: 20px;
       background-color: rgba(0,0,0.73); /* #BB000000, 0xBB = 187 / 255 = 0.73333 */
   }
   ```
   
   Of course, you'd also want to make sure you pad/margin your content by the same height.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org