2017-12-28 29 views

답변

0
//cancel method 

onCancel() { 
    console.log("CANCEL") 
    this.setState({visible:false}); 
} 

    //in render method 
     { 
      let shareOptions = { 
      title: "your app name", 
      message: "Sharing Test", 
      url: which url you want share, 
      subject: "Share" // for email 
      }; 

    // in retrun 

    <TouchableOpacity activeOpacity={.5} onPress={()=>{ 
       this.onCancel(); 
       setTimeout(() => { 
       Share.shareSingle(Object.assign(shareOptions, { 
        "social": "twitter" 
       })); 
       },300);}}> 
      <Image source={require('../images/twitter.png')} style={{resizeMode:"stretch",height:35,width:35,marginLeft:15}}/> 
      </TouchableOpacity>