react native touchableopacity disable
<TouchableOpacity disabled={true}>
<Text>I'm disabled</Text>
</TouchableOpacity>
react native touchableopacity disable
<TouchableOpacity disabled={true}>
<Text>I'm disabled</Text>
</TouchableOpacity>
touchableopacity as button in react native
//React Native Button element doesn't have style props and offers very
//few customization. Use TochableXXX elements instead.
//TouchableOpacity works fine
import {
TouchableOpacity,
Text,
} from "react-native";
<TouchableOpacity
style={styles.button}
onPress={this.onSubmit}
disabled={!this.state.isFormValid}
>
<Text style={styles.btnText}>Add
</Text>
</TouchableOpacity>
const styles = StyleSheet.create({
button: {
width: 200,
marginTop: 20,
backgroundColor: "green",
padding: 15,
borderRadius: 50,
},
btnText: {
color: "white",
fontSize: 20,
justifyContent: "center",
textAlign: "center",
},
});
react native ellipsis
// For Text compoment use numberOfLines and augment with ellipsizeMode
<View style = { styles.MainContainer }>
<Text style={styles.TextStyle} numberOfLines = { 1 } >
This is the Sample Ellipsis Text for Ellipsis from End.
</Text>
<Text style={styles.TextStyle} numberOfLines = { 1 } ellipsizeMode = 'head'>
This is the Sample Ellipsis Text for Ellipsis from Start.
</Text>
<Text style={styles.TextStyle} numberOfLines = { 1 } ellipsizeMode = 'middle'>
This is the Sample Ellipsis Text for Ellipsis from Middle.
</Text>
</View>
touchableopacity
<TouchableOpacity
style={styles.button}
onPress={onPress}
>
<Text>Press Here</Text>
</TouchableOpacity>
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us