// 计算合适高度
const _onLayout = useCallback((e) => {
let { x, y, width, height } = e.nativeEvent.layout
}, [])
<View onLayout={_onLayout}>
...
</View>
react-native获取指定元素宽高位置信息
最新推荐文章于 2024-04-30 18:21:50 发布
// 计算合适高度
const _onLayout = useCallback((e) => {
let { x, y, width, height } = e.nativeEvent.layout
}, [])
<View onLayout={_onLayout}>
...
</View>