cit*_*ice 2 android react-native
我有一个观点:
<View style={{height:this.state.pan.y}}></View>
Run Code Online (Sandbox Code Playgroud)
初始化状态:
...
constructor(props){
super(props);
this.state = {pan:new Animated.ValueXY()};
}
...
Run Code Online (Sandbox Code Playgroud)
它引发错误:
Failed prop type: Invalid prop `height` supplied to `View`.
Bad object: {
"height": 0
}
Run Code Online (Sandbox Code Playgroud)
但如果我设置:
<View style={{height:0}}></View>
Run Code Online (Sandbox Code Playgroud)
它为什么有效?
| 归档时间: |
|
| 查看次数: |
896 次 |
| 最近记录: |