reactNative 获取组件高、宽、位置等信息

import {findNodeHandle, UIManager} from 'react-native'

layout(ref) { const handle = findNodeHandle(ref); return new Promise((resolve) => { UIManager.measure(handle, (x, y, width, height, pageX, pageY) => { resolve({ x, y, width, height, pageX, pageY }); }); }); }

 

posted @ 2018-06-05 16:42  刘金宇  阅读(283)  评论(0编辑  收藏  举报