问题
I have a View as below
<View style={{width: '60%', flexDirection: 'row', flexWrap: 'wrap'}}>
{ .....}
{ .....}
<View>
if the items in the View are able to be rendered in the single line other wise View will be expanded to second line accordingly.
Here my doubt is , Is there any way to know programatically that View is wrapped?
回答1:
You can create reference to View and check its styles in its properties. Check here for how to create element reference https://reactjs.org/docs/refs-and-the-dom.html
来源:https://stackoverflow.com/questions/63245374/is-there-any-possibility-to-know-if-the-view-is-wrapped