Transitioning inside FlatList behaves differently on Android than on iOS
See original GitHub issueHey!
I noticed that transitioning inside a FlatList behaves different on Android than on iOS. On iOS the content in the list is pushed down, but on Android it is not.
Are there any solution for this problem or is there maybe a different way on achieving the same thing.
The code looks something like this:
const transition = (
<Transition.Sequence>
<Transition.Out type="fade" />
<Transition.Change interpolation="easeInOut" />
<Transition.In type="fade" />
</Transition.Sequence>
);
class TransitionExample extends React.Component {
transitionRef = React.createRef();
render() {
return (
<Transitioning.View ref={this.transitionRef} transition={transition}>
<FlatList
style={styles.container}
data={this.state.invoices}
keyExtractor={item => item.id}
renderItem={({ item }) => (
<Accordion>
{({ open, toggleAccordion }) => {
return (
<Fragment>
<TouchableWithoutFeedback
onPress={() => {
this.transitionRef.current.animateNextTransition();
toggleAccordion();
}}
>
<View style={styles.invoiceItem}>
<View style={styles.arrowDown}>
<ChevronArrowDown
style={open && styles.arrowUp}
width={18}
height={18}
fill={colors.ALT_GREY}
/>
</View>
<Text style={styles.date}>
Invoice Date: 03.04.2019
</Text>
<Text style={styles.billingPeriod}>
Billing period: 01.02 - 01.03.2018
</Text>
{open && <CostTable />}
</View>
</TouchableWithoutFeedback>
</Fragment>
);
}}
</Accordion>
)}
/>
</Transitioning.View>
);
}
}
iOS
Android
Issue Analytics
- State:
- Created 4 years ago
- Reactions:6
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Transitioning inside FlatList behaves differently on Android ...
Hey! I noticed that transitioning inside a FlatList behaves different on Android than on iOS. On iOS the content in the list is...
Read more >Spacing before and after a horizontal FlatList (React Native)
Seems like I was able to fix it by using a contentContainerStyle prop on the FlatList instead of passing it a style prop...
Read more >4. Components for Mobile - Learning React Native, 2nd ...
This varies somewhat from platform to platform: iOS behaves differently from Android, which behaves differently yet again from Windows Phone.
Read more >Tips for Optimizing React Native Application Performance: Part 1
In this article, we will discuss common pitfalls to avoid, and offer tips on optimizing your React Native application for performance before ...
Read more >react-native-video - npm
Start using react-native-video in your project by running `npm i ... Usage; iOS App Transport Security; Audio Mixing; Android Expansion File ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@jakub-gonet thanks for the heads up. It would be amazing to still have transitions in Reanimated 2. It’s a great API for difficult animations, such as dynamic height changes, accordions, and rearranging a list of items. It’s nice to be able to toss the transitioning view component in, and boom, UI changes look nice. The
transition
prop is a bit unintuitive to me, but it’s worth it for how powerful transitions are.Thanks for the great work!
We discussed Transitions internally in our team. Considering that v2 makes creating animations easier and Transitions was an experimental API for a long time, we decided to leave Transitions as they are.
We won’t actively fix bugs in them, but we’ll happily merge any PR with fixes. We’re also thinking about rewriting Transitions in v2 sometime in the future.
I’m closing this issue, but if you have further questions, I will be happy to help.