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.

inactiveSlideOpacity prop not working on Android

See original GitHub issue

Code:

<Carousel
    ref={c => {
        this._carousel = c;
    }}
    data={this.cards}
    renderItem={this._renderItem}
    sliderWidth={SCREEN_WIDTH}
    itemWidth={SCREEN_WIDTH}
    layout={"stack"}
    inactiveSlideOpacity={1}
    firstItem={Platform.OS == "android" ? this.cards.length - 1 : 0}
    containerCustomStyle={{
        transform: [{ scaleX: Platform.OS == "android" ? -1 : 1 }]
    }}
/>

As you can see, even if i set inactiveSlideOpacity to 1, the inactive cards still not have full opacity

Screen

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
bd-arccommented, Oct 22, 2019

@AndreaScapellato inactiveSlideOpacity has no effect over the stack layout.

What you need to do is provide your own custom interpolation. You can basically copy-paste the one created for the stack effect and get rid of the opacity interpolation.

0reactions
RWOverdijkcommented, Nov 1, 2019

@bd-arc Thanks for that, I’m glad I can remove the interpolation now 🎉

Read more comments on GitHub >

github_iconTop Results From Across the Web

inactiveSlideOpacity prop not working on Android #603 - GitHub
inactiveSlideOpacity prop not working on Android #603 ... if i set inactiveSlideOpacity to 1, the inactive cards still not have full opacity.
Read more >
why is the data not getting displayed using react native snap ...
I've just tried your code with remote images and didn't have any issue. Are you sure that the images you're trying to display...
Read more >
react-native-snap-carousel/CHANGELOG.md - UNPKG
46, * On Android, prevent loop and callback issues because scroll offset's value doesn't return an integer. 47, * Add prop `inactiveSlideShift` (see...
Read more >
react-native-snap-carousel - npm
On Android, you will experience issues with carousel's behavior when JS Dev ... Just pass your slides' data to the data prop, convert...
Read more >
react native flatlist infinite loop - You.com | The AI Search ...
The problem is, I would like to update the state so that a progress view shows the ... prop is not yet available...
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