React-native: [Android] ListView can't scroll when set position:'absolute' in style

Created on 23 Oct 2015  路  5Comments  路  Source: facebook/react-native

I wanna add a
mask layer on the ListView, I wrote JSX like this <View> <ListView style={{flex:1,position:'absolute',width:300}} ....../> <Mask ....../> </View>, now the ListView can't vertical scrolling, BUT the ListItem still can be clicked and the ViewPager rendered by method renderHeader can horizontal scrolling too. It bothered me for a long time. my react-native library's version is 0.12.0, seeking help and very grateful

Locked

Most helpful comment

Try top: 0, bottom: 0 instead of flex:1 with absolute positioning.

All 5 comments

Try top: 0, bottom: 0 instead of flex:1 with absolute positioning.

@ide Amazing!!!!! it works!!!! thanks a lot

but why use 'top: 0, bottom: 0' instead of 'flex:1' works!?
I am confused!

@ide you are awesome!

@ide you are good!

Was this page helpful?
0 / 5 - 0 ratings