-
Notifications
You must be signed in to change notification settings - Fork 93
When used together with FlatList as per instruction, RefreshControl renders under the navigation header. #138
Comments
@joonhocho I have same problem. Did you find any solution? |
There is I will get back to here if I find a workaround or a solution. |
https://stackoverflow.com/questions/56969502/progressviewoffset-for-ios-refresh-control-react-native This SOF answer says that we can use |
I encountered the same problem. Replacing the padding with However, I then ran into problems with my SectionList: the section header was also rendered with the contentInset. I did not manage to counter this and was not satisfied with all the platform specific exceptions in my components. As an alternative solution, I applied the const {
onScroll,
scrollIndicatorInsetTop,
containerPaddingTop,
translateY,
} = useCollapsibleStack()
return (
<Animated.SectionList
// other props
onScroll={onScroll}
scrollIndicatorInsets={{ bottom: scrollIndicatorInsetTop }}
contentContainerStyle={{ paddingBottom: containerPaddingTop }}
scrollEventThrottle={16} // without this, it can get jittery.
style={{
transform: [
{
translateY: translateY.interpolate({
inputRange: [0, containerPaddingTop],
outputRange: [containerPaddingTop, 2 * containerPaddingTop],
}),
},
],
}}
/>
) |
Android: It starts fluctuating / jitter screen while scrolling even different values of scrollEventtrottle is not solving it. |
You're right! I'm not sure how I missed this on my initial tests but it indeed jitters quite a lot. It seems the android scroll gesture does not like us moving the list up and down during the scroll motion. I did not find a good common solution so I ended up splitting my component into: AnimatedSectionList.ios.tsx which uses the above transelateY hack. AnimatedSectionList.android.tsx which uses the default collapsible header config and adds the |
Sorry about it. |
On Android, use progressViewOffset prop. progressViewOffset={paddingHeight} On iOS, In the following props, use what you need. contentInset={{ top: paddingHeight }} contentContainerStyle={{ paddingTop: Platform.OS === 'ios' ? 0 : paddingHeight }} contentOffset={{ y: -paddingHeight }} |
Information
Detail
When used together with FlatList as per instruction, RefreshControl renders under the navigation header.
The text was updated successfully, but these errors were encountered: