2017-04-06 30 views
1

,有像這樣的異常沒有問題,但在真正的手機上運行時我得到這個異常:陣營本地運行的模擬器上的iOS 10.3 iPhone 6應用程序時TouchableNativeFeedback.Ripple沒有發揮作用

_reactNative.TouchableNativeFeedback.Ripple is not function. (In '_reactNative.TouchableNativeFeeedback.Ripple(_platform2.default.androidRippleColor)','_reactNative.TochableNativeFeedback.Ripple' is undefined) 

當我在此組件上執行觸摸此happend:

<View style={styles.centerView}> 
    <TouchableOpacity style={styles.touch} onPress={this.openCamera} > 
     <Image 
      source={require('assets/img/camera.png')} 
      style={styles.cameraIcon} 
     > 

     </Image> 
    </TouchableOpacity> 
    <Text style={styles.text}>{translate.t('openCamera')}</Text> 
</View> 


var styles = StyleSheet.create({ 
    centerView: { 
     flex: 1, 
     alignItems: 'center', 
     justifyContent:'center', 
     flexDirection: 'column' 
    }, 

    cameraIcon: { 
     width:'100%', 
     height: '100%', 
     resizeMode: 'contain', 

    }, 

    touch: { 
     width:'80%', 
     height: '50%', 
     marginBottom: 15, 
     backgroundColor:"transparent" 
    }, 

    text: { 
     color: '#949494', 
     width:'85%', 
     alignSelf: 'center', 
     textAlign: 'center', 
     fontSize: responsiveFontSize(3), 
    }, 
}); 

和onPress是Actions.camera()調用反應路由器-Redux的磁通

此代碼在調試和遠程模式下的Android上工作。此代碼正在iOS模擬器上工作,但不適用於設備。

有人可以指我什麼可能是錯誤?

回答

0

TouchableNativeFeedback 一種用於製造包裝的意見正確地觸摸響應(僅適用於Android)。在Android上,此組件使用本機狀態drawable來顯示觸摸反饋。

使用TouchableHighlightTouchableOpacity

相關問題