元素类型无效:期望一个字符串或一个类/函数但得到:object(React Native)

时间:2017-08-16 02:40:49

标签: javascript ios react-native

我正在构建一个React Native应用程序,但是我似乎在渲染时遇到了一些困难。

错误告诉我检查“渲染方法”。

我不知道如何准确地检查这一点,但是根据我已经对此进行的研究,我知道这不是{}问题......

这是错误的截图,也是我的一些 screen shot of the error

下面是我用于index.ios.js的冗长代码 (这是我编辑和添加代码的唯一地方)

import React, { Component } from 'react';
import {
  AppRegistry,LayoutAnimation,StatusBar,
  StyleSheet,Image,ScrollView,ListView,Alert,
  Text,TouchableOpacity,TouchableHighlight,
  View,WebView,Dimensions,Platform,BackAndroid,ActivityIndicator
} from 'react-native';
import { Container, Content, Footer, FooterTab, Button, Icon, Badge ,List, ListItem,Left, Body, Right , Spinner} from 'native-base';
import Share, {ShareSheet} from 'react-native-share';
import LinearGradient from 'react-native-linear-gradient';
import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
import FontAwesome from 'react-native-vector-icons/FontAwesome';
import Entypo from 'react-native-vector-icons/Entypo';
const { width, height } = Dimensions.get("window");
const SideMenu = require('react-native-side-menu');
import {PullView} from 'react-native-pull';
import {
  AdMobBanner,
  AdMobInterstitial,
  PublisherBanner,
  AdMobRewarded
} from 'react-native-admob';

// Variables


var TopTitle = "YouTube";
var AppName = "YouTube";
var Subtitle = "My Tube App";
var webadress = 'https://www.youtube.com/';
var menupos = "left";
var slidemenu = true;
var tabmenu = true;
var spinercolor = "#C70000";

var foottexticon = "#FFFFFF";
var footbtncolor = "#E62117";
var footacrivebtncolor = "#CC181E";
var footupbar = "#CC181E";
var footmenu1 = ['th-large','Gallery','gallery','']; // icon-text-(web-gallery)-url
var footmenu2 = ['music','Music','web','https://www.youtube.com/channel/UCZcLjfDvDHsa5EgXsY-63lQ'];
var footmenu3 = ['smile-o','Funny','web','https://www.youtube.com/channel/UCaAZ2O-1wvipTqdbFv2cJJQ'];
var footmenu4 = ['home','Home','web','https://www.youtube.com/'];



var menutext = "#FFFFFF";
var menuicon = "#FFFFFF";
var menulinecolor = "#B20000";
var menubgcolor = "#333333";
var menuactivebgcolor = "#E62117";

var mencount = 4;
var sidemenu1 = ['home','Home','https://www.youtube.com/']; // icon-text-url
var sidemenu2 = ['user-md','Fitness','https://www.youtube.com/user/jlvi13'];
var sidemenu3 = ['film','Trailers','https://www.youtube.com/user/movieclipsTRAILERS'];
var sidemenu4 = ['feed','News','https://www.youtube.com/user/skynews'];
var sidemenu5 = ['arrow-circle-o-up','my menu style',''];
var sidemenu6 = ['trash-o','my menu style',''];

var alertitle = "About my App";
var alertnt1 = "OK";
var alertext = "watch best channels in my UTUBE app";

var galleryk = "url"; // url-fullimage
var gallery = [["https://yt3.ggpht.com/-sT1HsICSTxo/AAAAAAAAAAI/AAAAAAAAAAA/vIbnJ-_KKEE/s100-c-k-no-mo-rj-c0xffffff/photo.jpg","https://www.youtube.com/channel/UCv9rbAUUpoW0k8MP2R4UEJA"],["https://yt3.ggpht.com/-NYvVdBecXao/AAAAAAAAAAI/AAAAAAAAAAA/5KhxX9EOzvk/s100-c-k-no-mo-rj-c0xffffff/photo.jpg","https://www.youtube.com/user/aaronhipps"],["https://yt3.ggpht.com/-xjeq1t5vSyE/AAAAAAAAAAI/AAAAAAAAAAA/kboHvBqgdlo/s88-c-k-no-mo-rj-c0xffffff/photo.jpg","https://www.youtube.com/channel/UCwgURKfUA7e0Z7_qE3TvBFQ"],["https://yt3.ggpht.com/-QeoyK0Cy9ik/AAAAAAAAAAI/AAAAAAAAAAA/BlMXwG9I_Q8/s88-c-k-no-mo-rj-c0xffffff/photo.jpg","https://www.youtube.com/channel/UCoK5NOxkZBLfI_5eqf8Es4Q"],["https://yt3.ggpht.com/-6Zs1omhrM-E/AAAAAAAAAAI/AAAAAAAAAAA/Kf2Tfa9S2y0/s88-c-k-no-mo-rj-c0xffffff/photo.jpg","https://www.youtube.com/channel/UCaXDyLT3Xs4p8B0B79GFZCQ"]];
var galleryrow = 3;



// v 1.1
var showadv = false; // true-false
var adid = "ca-app-pub-3940256099942544/1033173712"; // admob id
var adbanner = false; // true-false
var adinterstitial = false; // true-false
var adinterstitialtime = 10; // check every : second
adinterstitialtime = adinterstitialtime * 1000;
var adinterstitialcount = 1; // how many times











var adinterval = 0;

export default class RedLine extends Component {


  constructor(props){
      super(props);

      var ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2});

console.disableYellowBox = true;
      this.state = {
        page:"splash",
        tpage:0,
        visible: false,
        dataSource: ds.cloneWithRows(gallery),
        cmenu1:false,cmenu2:false,cmenu3:false,cmenu4:false,cmenu5:false,cmenu6:false,
        isOpen:false,fullim:false,
      };



this.topIndicatorRender = this.topIndicatorRender.bind(this);

if(adinterstitial && showadv){
setInterval(() => {
if(adinterval < adinterstitialcount){
  AdMobInterstitial.setAdUnitID(adid);
  //AdMobInterstitial.setTestDeviceID('EMULATOR');
  AdMobInterstitial.requestAd(error => {
        AdMobInterstitial.showAd((error) => {});
      });
}
adinterval++;
}, adinterstitialtime);
}


    }










      renderRow(rowData: string, sectionID: number, rowID: number) {
          return (
            <TouchableOpacity underlayColor='rgba(0,0,0,0)' style={{backgroundColor: '#FFF', width: width/galleryrow, height: width/galleryrow}}
onPress={() => {

if(galleryk == "url"){
  webadress = rowData[1];
  this.setState({tpage:0,kind:"web"});
} else if(galleryk == "fullimage"){
this.setState({fullimu:rowData[0],fullim:true});
}


}}
              >
<View>

<Image
style={{width: width/galleryrow, height: width/galleryrow}}
source={{uri: rowData[0]}}
></Image>

</View>
            </TouchableOpacity>
          );
        }




        onPullRelease(resolve) {
          //do something
          this.myWebView.reload();
          setTimeout(() => {
                  resolve();
              }, 3000);
        }




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



      onNavigationStateChange(navState) {
        this.setState({
          canGoBack: navState.canGoBack
        });
      }
      onBack() {
        this.myWebView.goBack();
      }



componentWillMount () {
        BackAndroid.addEventListener('hardwareBackPress', this.backHandler);
}
componentWillUnmount () {
  BackAndroid.removeEventListener('hardwareBackPress', this.backHandler);
}
  backHandler = () => {
    if(this.state.canGoBack){
      this.onBack();
      return true;
    }
  }





  topIndicatorRender(pulling, pullok, pullrelease) {
          const hide = {position: 'absolute', left: 10000};
          const show = {position: 'relative', left: 0};
          setTimeout(() => {
              if (pulling) {
                  this.txtPulling && this.txtPulling.setNativeProps({style: show});
                  this.txtPullok && this.txtPullok.setNativeProps({style: hide});
                  this.txtPullrelease && this.txtPullrelease.setNativeProps({style: hide});
              } else if (pullok) {
                  this.txtPulling && this.txtPulling.setNativeProps({style: hide});
                  this.txtPullok && this.txtPullok.setNativeProps({style: show});
                  this.txtPullrelease && this.txtPullrelease.setNativeProps({style: hide});
              } else if (pullrelease) {
                  this.txtPulling && this.txtPulling.setNativeProps({style: hide});
                  this.txtPullok && this.txtPullok.setNativeProps({style: hide});
                  this.txtPullrelease && this.txtPullrelease.setNativeProps({style: show});
              }
          }, 1);
  		return (
              <View style={{flexDirection: 'row', justifyContent: 'center', alignItems: 'center', height: 60}}>
                  <ActivityIndicator size="small" color="gray" />
                  <Text ref={(c) => {this.txtPulling = c;}}> Pull Down to Refresh . . .</Text>
                  <Text ref={(c) => {this.txtPullok = c;}}> Release to Refresh . . .</Text>
                  <Text ref={(c) => {this.txtPullrelease = c;}}> Loading . . .</Text>
      		</View>
          );
  	}







  render() {


    let shareOptions = {
          title: "React Native",
          message: "Hola mundo",
          url: "http://facebook.github.io/react-native/",
          subject: "Share Link" //  for email
        };

    let shareImageBase64 = {
          title: "React Native",
          message: "Hola mundo",
          url: REACT_ICON,
          subject: "Share Link" //  for email
        };
















    if(this.state.page == "splash") {



    return(

      <View style={{flex:1,justifyContent: 'center', alignItems: 'center' , backgroundColor:"#E62117"}}>

    <View style={{justifyContent: 'center', alignItems: 'center' ,flex:0.7}}></View>
    <View style={{justifyContent: 'center', alignItems: 'center' ,flex:1}}>
      <Image onLayout={() => {
        setTimeout(() => {
          LayoutAnimation.easeInEaseOut();
           this.setState({page:"home"})
         }, 2000);
        }} style={{width: 0.4*width}} resizeMode={Image.resizeMode.contain}
        source={require('./files/logo.png')}
      />
    </View>



    <View style={{justifyContent: 'center', alignItems: 'center' ,flex:0.7}}></View>

      </View>

    );



    }















var Spiner = (<View></View>);
if(this.state.wload){
  Spiner = (<Spinner style={{position:"absolute",bottom:75,left:width/2.2}} color={spinercolor} ></Spinner>);
}









var smenu1 = (<View></View>);
var smenu2 = (<View></View>);
var smenu3 = (<View></View>);
var smenu4 = (<View></View>);
var smenu5 = (<View></View>);
var smenu6 = (<View></View>);



if(mencount > 0){

smenu1 = (<TouchableOpacity onPress={() => {
  this.setState({cmenu1:true,cmenu2:false,cmenu3:false,cmenu4:false,cmenu5:false,cmenu6:false,});
  webadress = sidemenu1[2];
  this.setState({kind:"web"});this.setState({ isOpen: !this.state.isOpen, });
}}
  style={this.state.cmenu1 ? mclick() : midle()}>

  <Text style={{ color:menutext , flex:4 , alignSelf:"center" , textAlign:"center" , fontWeight:"bold",marginRight:20}}>{sidemenu1[1]}</Text>
  <FontAwesome name={sidemenu1[0]} style={{fontSize:30, color:menuicon , flex:1, alignSelf:"center" , textAlign:"center",marginLeft:20}} ></FontAwesome>

</TouchableOpacity>);


if(mencount > 1){

smenu2 = (<TouchableOpacity onPress={() => {
  this.setState({cmenu1:false,cmenu2:true,cmenu3:false,cmenu4:false,cmenu5:false,cmenu6:false,});
  webadress = sidemenu2[2];
  this.setState({kind:"web"});this.setState({ isOpen: !this.state.isOpen, });
}}
  style={this.state.cmenu2 ? mclick() : midle()}>

  <Text style={{ color:menutext , flex:4 , alignSelf:"center" , textAlign:"center", fontWeight:"bold",marginRight:20}}>{sidemenu2[1]}</Text>
  <FontAwesome name={sidemenu2[0]} style={{fontSize:25, color:menuicon , flex:1, alignSelf:"center" , textAlign:"center",marginLeft:20}} ></FontAwesome>

</TouchableOpacity>);


if(mencount > 2){

smenu3 = (<TouchableOpacity onPress={() => {
  this.setState({cmenu1:false,cmenu2:false,cmenu3:true,cmenu4:false,cmenu5:false,cmenu6:false,});
  webadress = sidemenu3[2];
  this.setState({kind:"web"});this.setState({ isOpen: !this.state.isOpen, });
}}
  style={this.state.cmenu3 ? mclick() : midle()}>

  <Text style={{ color:menutext , flex:4 , alignSelf:"center" , textAlign:"center", fontWeight:"bold",marginRight:20}}>{sidemenu3[1]}</Text>
  <FontAwesome name={sidemenu3[0]} style={{fontSize:25, color:menuicon , flex:1, alignSelf:"center" , textAlign:"center",marginLeft:20}} ></FontAwesome>

</TouchableOpacity>);


if(mencount > 3){

smenu4 = (<TouchableOpacity onPress={() => {
  this.setState({cmenu1:false,cmenu2:false,cmenu3:false,cmenu4:true,cmenu5:false,cmenu6:false,});
  webadress = sidemenu4[2];
  this.setState({kind:"web"});this.setState({ isOpen: !this.state.isOpen, });
}}
  style={this.state.cmenu4 ? mclick() : midle()}>

  <Text style={{ color:menutext , flex:4 , alignSelf:"center" , textAlign:"center", fontWeight:"bold",marginRight:20}}>{sidemenu4[1]}</Text>
  <FontAwesome name={sidemenu4[0]} style={{fontSize:25, color:menuicon , flex:1, alignSelf:"center" , textAlign:"center",marginLeft:20}} ></FontAwesome>

</TouchableOpacity>);


if(mencount > 4){

smenu5 = (<TouchableOpacity onPress={() => {
  this.setState({cmenu1:false,cmenu2:false,cmenu3:false,cmenu4:false,cmenu5:true,cmenu6:false,});
  webadress = sidemenu5[2];
  this.setState({kind:"web"});this.setState({ isOpen: !this.state.isOpen, });
 }}
  style={this.state.cmenu5 ? mclick() : midle()}>

  <Text style={{ color:menutext , flex:4 , alignSelf:"center" , textAlign:"center", fontWeight:"bold",marginRight:20}}>{sidemenu5[1]}</Text>
  <FontAwesome name={sidemenu5[0]} style={{fontSize:25, color:menuicon , flex:1, alignSelf:"center" , textAlign:"center",marginLeft:20}} ></FontAwesome>

</TouchableOpacity>);


if(mencount > 5){

smenu6 = (<TouchableOpacity onPress={() => {
  this.setState({cmenu1:false,cmenu2:false,cmenu3:false,cmenu4:false,cmenu5:false,cmenu6:true,});
  webadress = sidemenu6[2];
  this.setState({kind:"web"});this.setState({ isOpen: !this.state.isOpen, });
 }}
  style={this.state.cmenu6 ? mclick() : midle()}>

  <Text style={{ color:menutext , flex:4 , alignSelf:"center" , textAlign:"center", fontWeight:"bold",marginRight:20}}>{sidemenu6[1]}</Text>
  <FontAwesome name={sidemenu6[0]} style={{fontSize:25, color:menuicon , flex:1, alignSelf:"center" , textAlign:"center",marginLeft:20}} ></FontAwesome>

</TouchableOpacity>);






}



}



}



}



}



}






var smenu = (<View style={{backgroundColor:menubgcolor,marginTop:(Platform.OS === 'ios' && slidemenu ? 20 : 0)}} >

<View style={{height:200,flexDirection:"column",justifyContent: 'center', backgroundColor:menubgcolor,borderBottomWidth:2 ,borderColor:menuactivebgcolor  }}>

  <Image  style={{width: 0.25*width , height:80, margin:10, alignSelf:"center" , textAlign:"center"}} resizeMode={Image.resizeMode.contain}
    source={require('./files/logo.png')}
  ></Image>

<Text style={{ color:menutext , height:30 , alignSelf:"center" , textAlign:"center",marginTop:12 , fontWeight:"bold" }}>{AppName}</Text>
<Text style={{ color:menutext , height:20 , alignSelf:"center" , textAlign:"center",marginTop:-6}}>{Subtitle}</Text>

</View>






{smenu1}
{smenu2}
{smenu3}
{smenu4}
{smenu5}
{smenu6}







<View style={{height:500, backgroundColor:menubgcolor}}>

</View>













          {/*<TouchableOpacity onPress={()=>{
            Share.open(shareOptions);
          }}>
            <View style={styles.instructions}>
              <Text>Simple Share</Text>
            </View>
          </TouchableOpacity>*/}


</View>);







var tmenu = (<View></View>);



tmenu = (
<View style={{width:width,height:50,backgroundColor:menubgcolor,marginTop:(Platform.OS === 'ios' && slidemenu ? 20 : 0), flexDirection:(menupos=="left" ? "row" : "row-reverse")  }}>

  <TouchableOpacity onPress={() => {this.setState({ isOpen: !this.state.isOpen, });}}  style={{  backgroundColor:menubgcolor ,flex:1 , alignItems:"center", justifyContent:"center", flexDirection:"row"}} >
    <Entypo name="menu" style={{ color:menuicon , flex:1, alignSelf:"center" , textAlign:"center",marginHorizontal:10, fontSize:30}} ></Entypo>
  </TouchableOpacity>

<View style={{  backgroundColor:menuactivebgcolor ,flex:4 , alignItems:"center", justifyContent:"center", flexDirection:"row"}} >
    <Text style={{ color:menutext , flex:4 , alignSelf:"center" , textAlign:"center" , fontSize:20 , fontWeight:"bold"}}>{TopTitle}</Text>
</View>

<TouchableOpacity onPress={() => {
  Alert.alert(
    alertitle,
    alertext,
    [
      {text: alertnt1, onPress: () => {  } },
    ],
    { cancelable: false }
  )

  }} style={{  backgroundColor:menubgcolor ,flex:1 , alignItems:"center" , justifyContent:"center", flexDirection:"row"}} >
  <MaterialIcons name="info-outline" style={{ color:menuicon , flex:1, alignSelf:"center" , textAlign:"center",marginHorizontal:10, fontSize:28}} ></MaterialIcons>
</TouchableOpacity>

</View>
);


var admob = (<View style={{height:0}}></View>);
if(adbanner && showadv){
var admob = (
  <View>
    <AdMobBanner
      style={{backgroundColor:"#fff"}}
    bannerSize="fullBanner"
    adUnitID={adid}
    testDeviceID="EMULATOR"
    didFailToReceiveAdWithError={this.bannerError} />
  {/*<PublisherBanner
      bannerSize="fullBanner"
      adUnitID="ca-app-pub-3940256099942544/6300978111"
      testDeviceID="EMULATOR"
      didFailToReceiveAdWithError={this.bannerError}
      admobDispatchAppEvent={this.adMobEvent} />*/}
  </View>
);
}


var fmenu = (<View></View>);
if(tabmenu){








  var tmen1 = (<Button style={{backgroundColor:footbtncolor , height:60 , borderRadius:0}} onPress={() => {this.setState({tpage:1,kind:footmenu1[2]});webadress=footmenu1[3];}}>
      <FontAwesome style={{color:foottexticon,fontSize:25,marginBottom:3}} name={footmenu1[0]} ></FontAwesome>
      <Text style={{color:foottexticon}} >{footmenu1[1]}</Text>
  </Button>);
  var tmen2 = (<Button style={{backgroundColor:footbtncolor , height:60 , borderRadius:0}} onPress={() => {this.setState({tpage:2,kind:footmenu2[2]});webadress=footmenu2[3];}}>
      <FontAwesome style={{color:foottexticon,fontSize:25,marginBottom:3}} name={footmenu2[0]} ></FontAwesome>
      <Text style={{color:foottexticon}} >{footmenu2[1]}</Text>
  </Button>);
  var tmen3 = (<Button style={{backgroundColor:footbtncolor , height:60 , borderRadius:0}} onPress={() => {this.setState({tpage:3,kind:footmenu3[2]});webadress=footmenu3[3];}}>
      <FontAwesome style={{color:foottexticon,fontSize:25,marginBottom:3}} name={footmenu3[0]} ></FontAwesome>
      <Text style={{color:foottexticon}} >{footmenu3[1]}</Text>
  </Button>);
  var tmen4 = (<Button style={{backgroundColor:footbtncolor , height:60 , borderRadius:0}}  onPress={() => {this.setState({tpage:4,kind:footmenu4[2]});webadress=footmenu4[3];}}>
      <FontAwesome style={{color:foottexticon,fontSize:25,marginBottom:3}} name={footmenu4[0]} ></FontAwesome>
      <Text style={{color:foottexticon}} >{footmenu4[1]}</Text>
  </Button>);







if(this.state.tpage == 1) {
tmen1 = (<Button style={{backgroundColor:footacrivebtncolor , height:60 , borderRadius:0}} active >
    <FontAwesome style={{color:foottexticon,fontSize:25,marginBottom:3}} active name={footmenu1[0]} ></FontAwesome>
    <Text style={{color:foottexticon}} >{footmenu1[1]}</Text>
</Button>);
}
if(this.state.tpage == 2) {
tmen2 = (<Button style={{backgroundColor:footacrivebtncolor , height:60 , borderRadius:0}} active >
    <FontAwesome style={{color:foottexticon,fontSize:25,marginBottom:3}} active name={footmenu2[0]} ></FontAwesome>
    <Text style={{color:foottexticon}} >{footmenu2[1]}</Text>
</Button>);
}
if(this.state.tpage == 3) {
tmen3 = (<Button style={{backgroundColor:footacrivebtncolor , height:60 , borderRadius:0}} active >
    <FontAwesome style={{color:foottexticon,fontSize:25,marginBottom:3}} active name={footmenu3[0]} ></FontAwesome>
    <Text style={{color:foottexticon}} >{footmenu3[1]}</Text>
</Button>);
}
if(this.state.tpage == 4) {
tmen4 = (<Button style={{backgroundColor:footacrivebtncolor , height:60 , borderRadius:0 }} active >
    <FontAwesome style={{color:foottexticon,fontSize:25,marginBottom:3}} active name={footmenu4[0]} ></FontAwesome>
    <Text style={{color:foottexticon}} >{footmenu4[1]}</Text>
</Button>);
}


fmenu = (<View style={{width:width,height:60}}>
                <FooterTab style={{flex: 1,backgroundColor:"#fff" ,borderTopWidth:4 , borderColor:footupbar}}>
                    {tmen1}
                    {tmen2}
                    {tmen3}
                    {tmen4}
                </FooterTab>
</View>);
}





var webview = (
<PullView topIndicatorRender={this.topIndicatorRender} onPullRelease={this.onPullRelease.bind(this)} style={{flex: 1,backgroundColor:"#FFF",marginTop:(Platform.OS === 'ios' && !slidemenu ? 20 : 0)}}>
  <WebView
ref={myWebView => { this.myWebView = myWebView; }}
source={{uri: webadress}}
style={{width: width,height:height}}
javaScriptEnabled={true}
domStorageEnabled={true}
onLoadStart={() => {
  this.setState({wload:true});
}}
onLoadEnd={() => {
  this.setState({wload:false});
}}
onNavigationStateChange= {this.onNavigationStateChange.bind(this)}
renderError={() => {
  return (
  <View style={{flex:1,alignItems:"center", justifyContent:"center",marginTop:50}}>
    <Text>
    No internet connection
    </Text>
    <Button style={{alignSelf:"center",marginTop:20}} onPress={() => {this.myWebView.reload()}} light><Text> Reload </Text></Button>
  </View>
)
}}
/>
</PullView>
);

var webviewback = (<View></View>);
var fullimage = (<View></View>);

if(this.state.kind == "gallery"){
webview = (<ListView
style={{flex: 1, backgroundColor:"#fff",marginTop:(Platform.OS === 'ios' && !slidemenu ? 20 : 0) }}
contentContainerStyle={{flexDirection: 'row', flexWrap: 'wrap'}}
dataSource={this.state.dataSource}
renderRow={this.renderRow.bind(this)}
></ListView>);
if(this.state.fullim && galleryk == "fullimage"){
fullimage = (<View style={{width: width ,height:height ,position:"absolute",top:0,right:0,backgroundColor:"rgba(0, 0, 0 , 0.8)" ,}}>

  <Image  style={{flex:1 , width: width  , alignSelf:"center" , textAlign:"center"}} resizeMode={Image.resizeMode.contain}
    source={{uri: this.state.fullimu}}
        ></Image>

      <TouchableOpacity onPress={() => { this.setState({fullim: false})}} style={{width: width/9, alignItems:"center" , justifyContent:"center" ,height:width/9  ,position:"absolute",top:width/15 ,right:width/15 ,backgroundColor:"rgba(255, 255, 255 , 0.2)" ,borderRadius:width/18 , }}>
  <Entypo style={{color:foottexticon, alignSelf:"center" , fontSize:30, color:"rgba(255, 255, 255 , 0.6)" , marginTop:2}} active name="cross" ></Entypo>
</TouchableOpacity>

</View>);
}

}else{
  webviewback = (<TouchableOpacity
disabled={!this.state.canGoBack} onPress={this.onBack.bind(this)}
    style={{width: 45, alignItems:"center" , justifyContent:"center" ,height:45  ,
      position:"absolute",bottom:width/3 ,right:-2 ,backgroundColor:"rgba(0, 0, 0 , 0.2)" ,borderRadius:2 }}>
  <Text style={{fontWeight:"bold" , fontSize:16 , color:"rgb(256, 256, 256 )"}} ><FontAwesome name="arrow-left" style={{fontSize:30, color:"#FFF" , flex:1, alignSelf:"center" , textAlign:"center"}} ></FontAwesome></Text>
  </TouchableOpacity>);
}




if(slidemenu){

    return (
      <SideMenu menu={smenu} menuPosition={menupos}
        isOpen={this.state.isOpen}
        onChange={(isOpen) => { this.setState({ isOpen, }); }}
        style={{marginTop:(Platform.OS === 'ios' && slidemenu ? 20 : 0)}}
        >

        <StatusBar
             backgroundColor="#000000"
             barStyle="default"
           ></StatusBar>


        <View style={styles.container}>



{tmenu}
{webview}

{admob}

{fmenu}

{Spiner}

{fullimage}


{webviewback}


        </View>
      </SideMenu>
    );

}else{

  return (
    <View style={{flex: 1}}>
      <View style={styles.container}>

{webview}

{fmenu}

{Spiner}

{fullimage}

      </View>
    </View>
  );

}






  }









}


mclick = function(options) {

if(menupos == "right"){

  return {
   height:50,
   flexDirection:"row",
   justifyContent: 'center',
   backgroundColor:menuactivebgcolor,
   borderRightWidth:5 ,
   borderColor:menulinecolor
  }

}else{

  return {
   height:50,
   flexDirection:"row-reverse",
   justifyContent: 'center',
   backgroundColor:menuactivebgcolor,
   borderLeftWidth:5 ,
   borderColor:menulinecolor
  }

}

 }



 midle = function(options) {

 if(menupos == "right"){

   return {
    height:50,
    flexDirection:"row",
    justifyContent: 'center',
    backgroundColor:menubgcolor,
   }

 }else{

   return {
    height:50,
    flexDirection:"row-reverse",
    justifyContent: 'center',
    backgroundColor:menubgcolor,
   }

 }

  }






const styles = StyleSheet.create({
  container: {
    flex: 1,
    //justifyContent: 'center',
    //alignItems: 'center',
    //backgroundColor: '#F5FCFF',
  },
  welcome: {
    fontSize: 20,
    textAlign: 'center',
    margin: 10,
  },
  instructions: {
    textAlign: 'center',
    color: '#333333',
    marginBottom: 5,
  },
  midle:{height:50,flexDirection:"row",justifyContent: 'center', backgroundColor:menubgcolor, },
  mclick:{height:50,flexDirection:"row",justifyContent: 'center', backgroundColor:menuactivebgcolor, borderRightWidth:5 , borderColor:menulinecolor,},
});

AppRegistry.registerComponent('RedLine', () => RedLine);

0 个答案:

没有答案