reactnative 設置背景圖片--ImageBackground

在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>

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章