// 计算合适高度
const _onLayout = useCallback((e) => {
let { x, y, width, height } = e.nativeEvent.layout
}, [])
<View onLayout={_onLayout}>
...
</View>版权声明:本文为weixin_40532650原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。
// 计算合适高度
const _onLayout = useCallback((e) => {
let { x, y, width, height } = e.nativeEvent.layout
}, [])
<View onLayout={_onLayout}>
...
</View>