kur*_*n26 4 javascript css react-native
我想让灰色框的位置固定,所以当我scrolldown或scrollup灰色框保持静止在其位置上时。
在 React Native 中可以做这样的事情吗?
这是我的代码:
<View>
<ScrollView>
<View style={styles.continueToPaymentContainer}>
</View>
</ScrollView>
</View>
container: {
flex: 1,
// justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#fff'
},
continueToPaymentContainer:{
width:width,
height: 100,
position:'absolute',
bottom:0,
backgroundColor: 'grey',
}
Run Code Online (Sandbox Code Playgroud)
尝试下面的代码。您只需将视图添加到滚动视图之外即可。
<View>
<ScrollView>
// Do your stuff
</ScrollView>
<View style={styles.continueToPaymentContainer}>
</View>
</View>
container: {
flex: 1,
// justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#fff'
},
continueToPaymentContainer:{
width:width,
height: 100,
position:'absolute',
bottom:0,
backgroundColor: 'grey',
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5331 次 |
| 最近记录: |