在RN版本0.46版本的時候添加了ImageBackground控件。ImageBackground可以設置背景圖片,使用方法和image一樣,裏面嵌套了其他的組件
<ImageBackground style={{ flex: 1 }}
source={require('../../res/image/login_beijing.png')}>
<View style={styles.connect} >
<View style={styles.oneline} >
<Image style={{ height: 25, width: 25, alignItems: 'center' }}
source={require('../../res/image/icon_yanzhengma.png')}
/>
<TextInput
ref='accountInputRef'
style={styles.input}
placeholder='請輸入賬號'/>
</View>
</View>
</ImageBackground>