P
P
pcdesign2019-05-29 07:36:18
React Native
pcdesign, 2019-05-29 07:36:18

How to fix the overlap of the last element?

Here's the snack:
https://snack.expo.io/@aimodding/overlay
I just generated 20 lines there: And here's what I get: the 20th element is hidden under the "basement".
const items = Array.from({length:20},(v,k)=>k+1);
5cee0be63df86373136773.jpeg

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Panteleev, 2019-05-29
@pcdesign

Add padding to the list to the height of the footer

<FlatList
    style={{ backgroundColor: background, marginBottom: 60 }}
>
...
</FlatList>

Z
zlends, 2019-06-01
@zlends

No, you should not remove the indents, since it will be more difficult to reuse them later in the future if you render the list as a separate component.
Remove position: 'absolute' and everything will be fine, it will stand exactly below the list.

const styles = StyleSheet.create({
  container: {
    flex: 1,
  },
  bottom: {
   position: 'absolute', // <-- удалите эту строку
    left: 0,
    right: 0,
    bottom: 0,
  },
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question