Working Example: Expo Snack
You can use TouchableRipple
instead:
import * as React from 'react';
import { View } from 'react-native';
import { Text, TouchableRipple } from 'react-native-paper';
const MyComponent = () => (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
<TouchableRipple
onPress={() => console.log('Pressed')}
rippleColor="rgba(255,0,0, 1)"
style={{ backgroundColor: 'grey', padding: 10, borderRadius: 5 }}>
<Text>Press anywhere</Text>
</TouchableRipple>
</View>
);
export default MyComponent;
Docs: touchable-ripple
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…