react-native-action-button icon indicating copy to clipboard operation
react-native-action-button copied to clipboard

How to use this component alongside with React Native's FlatList?

Open pedrovinicius opened this issue 7 years ago • 2 comments

I need to use this component in conjunction with React Native's FlatList. Currently, I have the following:

...
render() {
  return (
    <View>
      <FlatList />
      <ActionButton />
    </View>
  )
}

The problem I'm facing is that the ActionButton is being rendered at the bottom of the FlatList (that exceeds the screen size). This way, the user needs to scroll untill the list end to use the floating button. I need it floating at the bottom right of the screen, but above the flatlist, like an html div with position: fixed set up.

How to achieve that result?

pedrovinicius avatar Mar 18 '18 00:03 pedrovinicius

I was facing a similar issue in the sense that I wanted the ActionButton to be positioned relatively to other components in the view, not absolutely.

@PedroVinicius, check out my fork to see if it might work for you:

<ActionButton
   positioningMode="relative"
    offsetX={0}
    offsetY={0}
...

marcbc avatar May 11 '18 14:05 marcbc

I also faced this problem, just put your action button after ScrollView

Note: Always prefer to place FAB inside NativeBase <Container/>. Placing FAB inside <Content/> is not encouraged, as <Content/> is an implementation of <ScrollView/>.

Content is your FlatList, Container has View as example shows

vincentng291 avatar Nov 07 '18 15:11 vincentng291