How to specify the background color of a page?

113 views Asked by At

I don't understand how to specify the background color of a given page.

In app.json, I have the following:

  "window":{
    "backgroundColor": "#ff0000"
  }

This color is applied in the very background, I can see it if i try to scroll the page with my finger.

But my views are still white.

I tried to simply add the background color of my view and it is mostly working, but the last view is not expanding to the bottom of the screen, so I still have a white area.

How can I either:

  • Request all the view to be transparent so that I can see the background color specified in app.json
  • Create a view which expand to the bottom of the page, without creating a scrollbar
1

There are 1 answers

0
Robert On BEST ANSWER

There is a root element in Wechat Mini-program named page.

So the following code will make the work:

page
{
  background-color: red;
}