2
모달 슬라이드를 위로 올려 버튼 클릭으로 튀어 나오려고하지만 모달을 Animated.View 구성 요소로 래핑 할 때 작동하지 않습니다. 애니메이션 유형 소품 때문에 슬라이드가 진행되고 있지만 이후에는 아무런 변화가 없습니다. 어떤 아이디어? 기본이 주 반작용 기본 컨테이너에서 분리 네이티브 수준의보기에 포함되어 반작용에Animated가있는 Modal을 React Native로 애니메이트 할 수 있습니까?
//in render() function
<Animated.View
style={{
flex: 1,
transform: [ // `transform` is an ordered array
{ scale: this.state.bounceValue }, // Map `bounceValue` to `scale`
],
}}
>
<Modal
animationType={"slide"}
transparent={true}
visible={this.state.modalVisible}
>
<View style={styles.modalContainer}>
<View style={styles.modalInnerContainer}>
<ListView
dataSource={this.state.dataSource}
renderRow={this.renderRow}
/>
</View>
</View>
</Modal>
</Animated.View>
// onPress function
_onSelectFilter(rowID) {
if (this.state.modalVisible) {
this.state.bounceValue.setValue(2);
Animated.spring(
this.state.bounceValue,
{
toValue: 0.8,
friction: 1,
}
).start();
}
}
저는 완전히 JS (react-native-modalbox) 인 타사 모듈을 발견했으며 사용자 정의가 가능합니다! – damir46