is there any possibility to know if the View is wrapped

北城余情 提交于 2021-01-29 22:21:13

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!