Skip to content

iOS Dark Theme interferes with my theme in ListView and HtmlView #8989

@crowmagnumb

Description

@crowmagnumb

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: 7.0.8
  • Cross-platform modules:
  • Android Runtime: 7.0.1
  • iOS Runtime: 7.0.4
  • XCode Version: 12.0.1
  • Plugin(s):
    "@nativescript/angular": "^10.0.0",

Describe the bug

I am not using nativescript/themes. I have my own theme that apply mostly through css and have my own dark theme. If my iOS device is set on dark mode, my app looks totally fine with the excetpion of ListView and HtmlView in which my standard theme is ignored in favor of the system dark mode.

I added the following scss code to solve this ...

        ListView {
            background-color: transparent;
        }

        ListView > * {
            background-color: map-get($au-theme, surface);
            // background-color: transparent;
        }

... where my surface color is white in my light mode and black in my dark mode. Setting the ListView to transparent works for it but then I have to set each item to have a "surface" background as transparent doesn't work here. I was also sometimes using a margin in my item elements but that results in a black margin so I had to change those to padding instead. I'm using angular with an ng-template for each ListView element here.

To Reproduce

Put your iOS in dark mode. Create a panel with a white background and on that panel put a ListView. I propose that the ListView and all its elements should show up with a white background.

Expected behavior

The ListView should be using transparent backgrounds I think.

HtmlView is a bit harder I think. I currently use it for my simple message boxes. I allow the developer to put simple html into the message, basically so that I can use the "pre" tag if I want to display a stack trace or other such snippet in its exact spacing". But also allows bolding and a few other things. If in light theme on my app, my whole dialog box is a light theme exccept for the main message part which is dark themed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions