RN 获取组件的 position 等基本属性

2017-06-15  本文已影响54人  M4不会点AWM不会顺
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)
    })
  }
}
上一篇 下一篇

猜你喜欢

热点阅读