Comments (8)
@NewOldMax Absolutely :) The only distinctive characteristic of your example is the background animation. In order to do that, you'll need to rely on the onSnapToItem
prop. It will then be easy to update the color based on current slide's index.
Still, be aware that, as stated in this issue, the callback will be fired immediately after clicking. If this is not a deal-breaker for you, you're good to go.
Do not hesitate to share your experimentations!
from react-native-snap-carousel.
I already implemented it :)
It works fine with touches, but I have some issues with swipe, for example, i can't swipe to end of carousel at one time, or sometimes position of last element is wrong
from react-native-snap-carousel.
@NewOldMax Cool ;) Regarding your issues:
-
Scroll inertia varies depending on slide's size relative to viewport's size, e.g. the larger your slide is, the more difficult it is to swipe more than one slide at a time. You can try playing with this ScrollView prop and see if it helps.
-
The positioning issue is clearly the same as #33, but I wasn't able to reproduce it, either on a simulator nor a real device... Would you mind sharing the source code of your project so I can take a look at it? You can mail a zip file to me if you don't want it to go public ;)
from react-native-snap-carousel.
Would you mind sharing the source code of your project so I can take a look at it?
I'll create some reproduction component on next week.
You can try playing with this ScrollView prop and see if it helps.
Unfortunately I'm working only with android, so this prop couldn't help me :(
from react-native-snap-carousel.
Unfortunately I'm working only with android, so this prop couldn't help me :(
And does playing with enableMomentum
change anything for you?
from react-native-snap-carousel.
As I remember, with momentum behavior was strange, but I'm not sure
from react-native-snap-carousel.
Seems to I fixed wrong offset with dynamic changing width of items.
const itemWidth = width * (index === 2 ? 0.6 : 0.65);
where index
- index of selected item, index = 2
- my last item, and width
- screen width
After this I can't reproduce case with wrong position.
from react-native-snap-carousel.
@NewOldMax Ok, good to know. I confirm that dynamically changing items' width will lead to issues since this value is critical for snap thresholds' calculation and must remain the same for all items.
from react-native-snap-carousel.
Related Issues (20)
- how to detect slide animation end??
- snap carousel
- ViewPropTypes will be removed from React native HOT 1
- Fix ViewPropTypes usage for deprecated prop types HOT 2
- !!!! DEPRECATED !!!! react-native-snap-carousel
- Cannot read property 'array' of undefined HOT 3
- Upgrade this to new react-native version 0.71
- viewproptypes will be removed from react native issue, fixed. HOT 4
- The loop simply stops while swiping right when it reaches the 3rd index HOT 5
- ViewPropTypes will be removed from React Native, along with all other PropTypes HOT 1
- Align carousel items to the left. HOT 1
- accessing touch gesture handler or control from carousel component
- error while updating property 'transform' of a view managed by rctview
- ViewPropTypes is deprecated HOT 6
- custom carousel with centered image and 2 images in each side
- ViewPropTypes needs to be exported from 'deprecated-react-native-prop-types' package instead 'react-native' HOT 4
- sub Element cannot response click event when scrollView is scrolling. HOT 1
- Dynamic Height Content in Carousel
- when i set startAutoplay to true, it cannot auto play, i do not know wht
- white space is coming if I disabled the infinite scroll HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-snap-carousel.