react native 自适应高度

在项目中可能会遇到这样的需求,可使用onlayout获取高度,而后设置上去。函数 先在须要获取高度的地方绑定一个函数,this <View style={styles.OilCon} onLayout={this.changeViewLayout.bind(this)}> <Text>hello, I am Test.</Text> </View> <View ref={test=> {
相关文章
相关标签/搜索