我想知道如何在其中插入图像??
我也想知道这是在css上实现的javascript还是在javascript中实现的css?
它是由React Native自动生成的,作为默认的应用程序初学者包,我们刚刚开始掌握基础知识……
import React, {
AppRegistry,
Component,
StyleSheet,
Text,
View
} from 'react-native';
class VLDB extends Component {
render() {
return (
<View style={styles.container}>
<Text style = {styles.welcome}>
VLDB SQL Cheat Sheet!
</Text>
<Text style={styles.welcome}>
Welcome to the SQL Cheat Sheet!
</Text>
<Text style={styles.instructions}>
To get started, edit index.ios.js
</Text>
<Text style={styles.instructions}>
Press Cmd+R to reload,{'\n'}
Cmd+D or shake for dev menu
</Text>
</View>
);
}
}
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,
},
});
AppRegistry.registerComponent('VLDB', () => VLDB);干杯,卢克。
发布于 2016-04-04 23:03:10
要向其中添加图像,首先需要在图像组件中导入
import React, {
AppRegistry,
Component,
Image,
StyleSheet,
Text,
View
} from 'react-native';然后,通过引用本地捆绑的映像或远程映像来添加the documentation中描述的映像,如下所示……
class VLDB extends Component {
render() {
return (
<View style={styles.container}>
<Image
style={styles.icon}
source={require('./myIcon.png')}
/>
<Image
style={styles.logo}
source={{uri: 'http://facebook.github.io/react/img/logo_og.png'}}
/>
<Text style = {styles.welcome}>
VLDB SQL Cheat Sheet!
</Text>
<Text style={styles.welcome}>
Welcome to the SQL Cheat Sheet!
</Text>
<Text style={styles.instructions}>
To get started, edit index.ios.js
</Text>
<Text style={styles.instructions}>
Press Cmd+R to reload,{'\n'}
Cmd+D or shake for dev menu
</Text>
</View>
);
}
}https://stackoverflow.com/questions/36405922
复制相似问题