Open KingAmo opened 4 years ago
it depends; but without a specific height, ViewPager show nothing
Why you can't :
<ViewPager style={[styles.viewPager, { height: whatEverHeight }]} />
Why you can't :
<ViewPager style={[styles.viewPager, { height: whatEverHeight }]} />
because i want ViewPager just wrap the children, and the children's height is depend on fetched data from api
Why you can't :
const [height, setHeight] = useState(0)
<ViewPager style={[styles.viewPager, { height: height }]} >
<Child setHeight={setHeight} />
</ViewPager>
@KingAmo your issue refers to https://github.com/react-native-community/react-native-viewpager/issues/162
Question
the example in
readme
provide astyle={{ flex: 1 }}
toViewPager
(like bellow),and it occupy all screen height; but in my case, the pager's height is not specific,it depends; but without a specific height,ViewPager
show nothingso, could the height of
ViewPager
be flexible ?