TouchableOpacity根本不起作用-反应本机

时间:2018-10-05 08:54:32

标签: javascript react-native

这是我的代码:

$creds = "$($BASIC_AUTH_USER):$($BASIC_AUTH_PASS)"
$encodedCreds = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($creds))
$basicAuthValue = "Basic $encodedCreds"

$url = "http://your.url"
$request = [System.Net.WebRequest]::CreateHttp($url);   
$request.Method = "post"
$request.Headers.Add("Authorization", $basicAuthValue)
$request.AllowAutoRedirect = $false

$body = "your formatted data goes here"
$bytes = [System.Text.Encoding]::UTF8.GetBytes($body);
$stream = $request.GetRequestStream()
$stream.Write($bytes, 0, $bytes.Length);
$stream.Close();

$request.GetResponse();

<TouchableOpacity style={{height:100,width:'100%'}} onPress={()=>this.aba()}>
              <Text style={{position:'absolute',top:0,right:0,marginTop:10,marginRight:10,fontSize:18}}>total</Text>
              <Text style={{position:'absolute',top:0,left:0,marginTop:10,marginLeft:10,fontSize:18,color:'#7fbe41'}}>100$</Text>


              <View style={{bottom:0,position:'absolute',width:'100%',padding:10}}>
                <Button   success style={{alignSelf:'center',width:'100%',justifyContent:'center',}}>
                  <Text   style={{textAlign:'center',color:'#fff',fontSize:18,zIndex:10,width:'100%',height:'100%'}}>continue</Text>
                </Button>
              </View>
</TouchableOpacity>

已更新

所有代码:

 aba(){
   console.log("masoud")
 }

constructor(props) {
   super(props);
   this.state = {};

   this.goTo          = this.goTo.bind(this)
   this.aba          = this.aba.bind(this)

 }

0 个答案:

没有答案