Reactjs 滚动视图中的图像背景不工作

Reactjs 滚动视图中的图像背景不工作,reactjs,react-native,scrollview,Reactjs,React Native,Scrollview,我是react native的新手,我必须设计一个屏幕,当列表变长时,我意识到我的滚动视图不工作,这里是我的代码下面,请分享建议…谢谢 <View style={{flex:1}}> <ActionBar containerStyle={{height:60,alignItems: 'center'}} backgroundColor={'#fff'} title={'Select Categories'} titleSt

我是react native的新手,我必须设计一个屏幕,当列表变长时,我意识到我的滚动视图不工作,这里是我的代码下面,请分享建议…谢谢

<View style={{flex:1}}>
    <ActionBar
      containerStyle={{height:60,alignItems: 'center'}}
      backgroundColor={'#fff'}
      title={'Select Categories'}
      titleStyle={styles.pageTitle}
      onLeftPress={() => goBack()}
      leftIconContainerStyle={{marginTop:22}}
      leftIconName={'back'}
      leftIconImageStyle={{backgroundColor:'#333',height:18,width:18}}
    />
    <Image source={require('../images/bg-login.jpg')}
     style={{position:'absolute',left:0,right:0,top:0,bottom:0}} />
     <ScrollView style={{backgroundColor:'#00000000',position:'absolute',left:0,right:0,top:0,bottom:0}} >
        {views}
    </ScrollView>
    <View style={styles.footerSec}>
        <TouchableOpacity style={styles.nextBtn}
          onPress={()=> {this.props.navigation.navigate('Tutorials',{tutId:this.state.selectedCats})}}>
          <Text style={[styles.btnText, styles.priceText]}>Next</Text>
        </TouchableOpacity>
    </View>
  </View>


您可以使用普通图像来放置背景图像,使用position='absolute'并将ScrollView的背景色不透明度设置为#00000000,这意味着它将是透明的

范例

<Image
 source={require('../images/bg-login.jpg')}
 style={{position:'absolute',
 left:0, 
 right:0, 
 top:0,
 bottom:0}} />
 <ScrollView 
  style={{backgroundColor:'#00000000',
  position:'absolute',
  left:0,
  right:0,
  top:0,
  bottom:0}} >
    <View>
        <Text>Some content</Text>
    </View>
</ScrollView>

一些内容

您可以使用普通图像来放置背景图像,使用position='absolute'并将ScrollView的背景色不透明度设置为#00000000,这意味着它将是透明的

范例

<Image
 source={require('../images/bg-login.jpg')}
 style={{position:'absolute',
 left:0, 
 right:0, 
 top:0,
 bottom:0}} />
 <ScrollView 
  style={{backgroundColor:'#00000000',
  position:'absolute',
  left:0,
  right:0,
  top:0,
  bottom:0}} >
    <View>
        <Text>Some content</Text>
    </View>
</ScrollView>

一些内容

对于我在下面代码中使用的滚动视图问题,它在任何地方都可以正常工作

<ScrollView contentContainerStyle={{ paddingBottom: 120 }}>
---code---

</ScrollView>

---代码---

对于我在下面代码中使用的滚动视图问题,它在任何地方都可以正常工作

<ScrollView contentContainerStyle={{ paddingBottom: 120 }}>
---code---

</ScrollView>

---代码---

为什么坏了,除非你告诉我们什么坏了,否则我们帮不了你。以上代码的结果是什么?你期望它做什么?请添加更多信息,我们将非常乐意为您提供帮助。我刚刚更新了我的代码。您有
{views}
什么是视图?我猜您的视图可能有flex:1?这将导致您描述的行为。需要删除视图上的flex:1。但是,是的,张贴代码将帮助我们帮助你。仍然是相同的问题…我与你分享我的文件链接,请检查是否有任何可能这是我的最后期限为这个项目,真的非常感谢你的答复。为什么坏了,除非你告诉我们什么坏了,否则我们帮不了你。以上代码的结果是什么?你期望它做什么?请添加更多信息,我们将非常乐意为您提供帮助。我刚刚更新了我的代码。您有
{views}
什么是视图?我猜您的视图可能有flex:1?这将导致您描述的行为。需要删除视图上的flex:1。但是,是的,张贴代码将帮助我们帮助你。仍然是相同的问题…我与你分享我的文件链接,请检查是否有任何可能这是我的最后期限为这个项目,真的非常感谢你的答复。