BÀI 22 - ONPRESS IMAGE TRONG REACT NATIVE

Tham khảo tại đây

  • Có 2 cách: Cách 1 như sau

<TouchableOpacity

style={StyleSignIn.SignInWithGoogle}

onPress={() => {console.log("đăng nhập google")}}>

<Image

source={require('../images/google_logo.png')}

style={{ width: 200, height: 30, borderRadius: 10 }}

/>

</TouchableOpacity>

  • Để di chuyển giữa các màn hình thì thay đổi name của component Stack.Screen

<TouchableHighlight onPress={() => this.moveToAddNewCustomer()}>

<Image style={styles.imagestyle} source={require('./ic_action_name.png')} />

</TouchableHighlight>