Mic*_*kes 2 scrollview ios react-native react-native-ios
我有一个问题,ScrollViewClass是未定义的,但仅在应用程序的一个位置,仅适用于react-native中的iOS版本.
ScrollView在应用程序中的多个位置使用并且工作正常但在应用程序的这个特定部分中,它会导致错误屏幕指出 ScrollViewClass must not be undefined
<ScrollView style={styles.descriptionContainer}
contentContainerStyle={styles.descriptionContainerInner}>
{/* The description text */}
<Text style={styles.descriptionText}>
{this.state.description}
</Text>
</ScrollView>
Run Code Online (Sandbox Code Playgroud)
......基本上,有一个糟糕的平等检查:
if (Platform.OS = 'android') { ...
对于
componentDidMount() {
if (Platform.OS === 'android') {
BackAndroid.addEventListener('hardwareBackPress', this.handleBackOnOverlay);
}
Run Code Online (Sandbox Code Playgroud)
这导致在iOS应用程序中为Android后退按钮添加了事件侦听器.看来上述错误就是这样的结果.永远不要假设错误消息是错误.
| 归档时间: |
|
| 查看次数: |
606 次 |
| 最近记录: |