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.

How change handle color

See original GitHub issue

How can I change the handle color? I have tried this:

  <BottomSheet
    ref={this.bottomSheetRef}
    index={-1}
    snapPoints={[0, 255]}
    onChange={this.onChange}
    backdropComponent={BottomSheetBackdrop}
    handleComponent={() =>
      <View style={styles.closeLineContainer}>
        <View style={styles.closeLine}></View>
      </View>
    }
  >
    ...
  </BottomSheet>

styles:

  closeLineContainer: {
    alignSelf: 'center'
  },
  closeLine: {
    width: 40,
    height: 6,
    borderRadius: 3,
    backgroundColor: Colors.lightGray,
    marginTop: 9,
  },

This is the result: Schermata 2021-01-06 alle 14 44 34

As you can see there i a space in the bottom that I don’t know how I can remove, instead if I remove the custom handleComponent I get this that is what I want:

Schermata 2021-01-06 alle 14 46 20

So my question is, how can I just change the handle color?

Library Version
@gorhom/bottom-sheet 2.0.0
react-native 0.63.3
react-native-reanimated 1.13.2
react-native-gesture-handler 1.9.0

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:13 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
Piero87commented, Jan 11, 2021

@gorhom Thank for the answer, you have to add also the custom handler:

 backgroundComponent={() =>
          <View style={styles.contentContainer}/>
        }
handleComponent={() =>
  <View style={styles.closeLineContainer}>
    <View style={styles.closeLine}></View>
  </View>
}
const styles = StyleSheet.create({
  contentContainer: {
    ...StyleSheet.absoluteFillObject,
    borderTopLeftRadius: 10,
    borderTopRightRadius: 10,
    backgroundColor: 'red'
  },
  closeLineContainer: {
    alignSelf: 'center'
  },
  closeLine: {
    width: 40,
    height: 6,
    borderRadius: 3,
    backgroundColor: Colors.lightGray,
    marginTop: 9,
  },
})

In your image above I see that you haven’t used it

3reactions
Piero87commented, Jan 6, 2021

@gorhom Now it works! thank you very much!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Color matching and replacing my broken door handle - YouTube
I decided it was time to replace a broke door handle i have had for a while now, I wanted to show you...
Read more >
Color Changing Wrap For Tesla Model 3 Door Handles!!! How ...
I bought these color changing wraps for my 2020 Tesla Model 3 on Amazon Prime with my own money! Honest review, and how...
Read more >
How to Change the Color of Your Name on Twitch
‍The second option to change your Twitch username color is by typing /color in chat. When you type /color it'll bring up a...
Read more >
How to Change the Color of Your Name on Twitch - Lifewire
There's an easy chat command for changing your name color, too. Just type /color followed by the color you want to use. You...
Read more >
How To Change the Username Color on Discord - ITGeared
If you want to change the color of your username, you must be the server's admin. Server admins can create roles and assign...
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