0
measure()
의 도움으로 여러 값을 측정해야합니다.여러 개의 "측정"작업을 동 기적으로 호출하십시오.
this.refContainerView.measure((x, y, width, height, pageX, pageY) => {
const containerViewHeight = height
this.refCommentList.measure((x, y, width, height, pageX, pageY) => {
const commentListOffset = pageY
const commentListHeight = height
// do something
})
})
을 더 많은 구성 요소를 측정하기 위해 필요한 경우, 그것은 콜백 지옥과 같습니다
는 비동기 작업이기 때문에, 난 단지 쓸 수 있습니다.
코드를 동기식으로 작성할 수 있습니까? 예 : await
또는 기타의 도움으로 예 :
const contaierView = this.refContainerView.measure()
const commentList = this.refCommentList.measure()
// and then do something with
contaierView {x, y, width, height, pageX, pageY}
commentList {x, y, width, height, pageX, pageY}