我有一个运行良好的点击动画,但我无法让实际的动画元素更加“放大”。它看起来像这样:
这是代码:
import { Animated, TouchableHighlight } from 'react-native';
import Animation from 'lottie-react-native';
// a bunch of code here
render() {
return (
<TouchableHighlight
onPress={this.animate}
underlayColor="transparent"
>
<Animation
style={{
backgroundColor: 'red',
width: 150,
height: 150,
}}
source={favoriteHeart}
progress={this.state.progress}
/>
</TouchableHighlight>
);
}
父视图没有什么好笑的,所以我真的很困惑为什么心脏没有占据动画视图的全部宽度和高度。这也使得将该元素放置在任一图标旁边变得困难。