question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Drawer content color keep dark

See original GitHub issue
import React from 'react';
import { Container, Drawer, Button, Icon, Content, Text } from 'native-base';

export default class App extends React.Component {
  static navigationOptions = {
    header: null,
  };
  closeDrawer = () => {
    this.drawer._root.close()
  };
  openDrawer = () => {
    this.drawer._root.open()
  };

  render() {
    return (
      <Drawer
        ref={(ref) => { this.drawer = ref; }}
        content={<Content style={{ backgroundColor: '#FFFFFF' }}>
          <Text>Drawer</Text>
        </Content>}>
              <Button onPress={() => this.openDrawer()} transparent>
              <Icon name='menu' />
            </Button>
      </Drawer>
    )
  }
}
screen shot 2018-09-28 at 4 47 46 pm

Expect result: Drawer content is light and white color.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:9

github_iconTop GitHub Comments

30reactions
suishumcommented, Oct 5, 2018

Managed to fix this issue by digging into the default properties of the Drawer component, by default the Drawer component’s overlay has an elevation property of 8.

The elevation prop only effects Android (which is why this problem is not present in iOS) - to change the default props you can do this:

import { Drawer } from 'native-base';
...
Drawer.defaultProps.styles.mainOverlay.elevation = 0;

or wait until the above PR is merged (:

2reactions
andreslopezdreamscommented, Oct 1, 2018

I still have the same problem, try zIndex and it does not work either, the only thing I could change is the type to displace

<Drawer type=“displace” …

Node: 8.12.0 Mac OS: Mojave react-native: 0.57.1 native-base: ^2.8.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

Disable dark fading in Navigation Drawer
You can use setScrimColor(int color) method. As default color is used 0x99000000 . So if you don't want faded background, set transparent color...
Read more >
Modify fade effect of background when Drawer widget is ...
Since the fade effect that happens when the Drawer is opened is to fade to 'Colors. black54' (Black with opacity 54%) the Drawer's...
Read more >
IRIS USA 6 Quart Compact Stacking Storage Drawer ...
Details. Color. Black. Material. Plastic.
Read more >
Fragment Navigation Drawer | CodePath Android Cliffnotes
This guide explains how to setup a basic material design style drawer filled with navigation items that switch different fragments into the content...
Read more >
Re: Drawer TEXT color same as BACKGROUND color (help!)
The text of my Cart drawer is white — and so is the background — so you can't see it. I need to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found