RN 获取组件的 position 等基本属性
classMyComponentextendsReact.component{
render(){return}componentDidMount(){
// Print component dimensions to consolethis.refs.mycomponent.measure((fx,fy,width,height,px,py)=>{
console.log('Component width is: '+width)
console.log('Component height is: '+height)
console.log('X offset to frame: '+fx)
console.log('Y offset to frame: '+fy)
console.log('X offset to page: '+px)
console.log('Y offset to page: '+py)
})
}
}
本文标题:RN 获取组件的 position 等基本属性
本文链接:https://www.haomeiwen.com/subject/trdyqxtx.html
网友评论