启动(...):渲染未返回任何内容。这通常意味着缺少返回语句。或者,若要不呈现任何内容,则返回null。
import React, { component } from 'react';
import {View, ImageBackground,Image} from 'react-native';
import { Component } from 'react';
var bg=require('./background.png');
var logo=require('./logo.jpg');
export default class Splash extends Component
{
render()
{
<ImageBackground
source={bg}
style={{height: '100%',width:'100%'}}
>
<View
style={{flex:1,justifyContent:'center',alignItems:'center'}}
>
<image source={logo}
style={{height:100,width:100}}></image>
</View>
</ImageBackground>
}
}发布于 2020-06-10 18:57:37
您需要这样的return关键字:
export default class Splash extends Component
{
render(){
return(
<ImageBackground
source={bg}
style={{height: '100%',width:'100%'}}>
<View style={{flex:1,justifyContent:'center',alignItems:'center'}}>
<image source={logo}
style={{height:100,width:100}}></image>
</View>
</ImageBackground>
)
}
}https://stackoverflow.com/questions/62298188
复制相似问题