1
我试着去实现一个屏幕过渡效果,当用户点击一个框组件(滚动型内),图像将scale
并移动到顶部,制作的Airbnb有一个很好的例子:使用React Native实现缩放屏幕过渡?
<ScrollView>
<Box /> // onPress the scaleImage comp should move to top screen
<Box /> // regardless of scroll position
<Box />
<Box />
...
</ScrollView>
<Animated.Image
style={styles.scaleImage}
source={this.state.activeImage} />
我知道如何实现这个动画的一部分,但问题是我有布局,如果Im试图缩放和移动到顶部的图像在ScrollView中,我如何确定距离到顶部。
谢谢,这是做到了。措施应该更好地记录。 –