に供給無効プロップ` Iビュー有する:INIT状態に[反応ネイティブ] height`が `View`
<View style={{height:this.state.pan.y}}></View>
:
...
constructor(props){
super(props);
this.state = {pan:new Animated.ValueXY()};
}
...
をそれがエラーをスロー:
Failed prop type: Invalid prop `height` supplied to `View`.
Bad object: {
"height": 0
}
もし私が設定した場合:
<View style={{height:0}}></View>
それは動作します、なぜですか?
ありがとう、あなたは正しいですが、translateYの同じコードが動作します。 – cityvoice
これを将来経験している方には、本当の解決方法は、 'Animated' * - ' Animated.View>を使用している場合、 '。 –
Li357