React native 滚动到FlatList的页脚组件
我有一个问题,我不知道如何使我的滚动到页脚。我试图希望它像一个滚动视图,但没有工作。 // StaskOverflow认为这里没有什么描述,但我不知道还要补充什么,我将回答主要问题React native 滚动到FlatList的页脚组件,react-native,scroll,react-native-flatlist,React Native,Scroll,React Native Flatlist,我有一个问题,我不知道如何使我的滚动到页脚。我试图希望它像一个滚动视图,但没有工作。 // StaskOverflow认为这里没有什么描述,但我不知道还要补充什么,我将回答主要问题 <FlatList ref={(scroll) => this.scroll = scroll} contentContainerStyle={{
<FlatList
ref={(scroll) => this.scroll = scroll}
contentContainerStyle={{
alignSelf: 'center',
alignItems: 'center',
width: '100%'
}}
style={{
height: '100%',
backgroundColor: COLORS.LIST_BACKGROUND
}}
data={this.props.cartItems.list}
keyExtractor={(item, index) => `${item.ID}`}
ListFooterComponent={this.renderFooterComponent()}
renderItem={this.renderStudent}
/>
renderDiscountInput = () => (
<View style={[styles.row, styles.discountInputWrapper]}>
<View style={styles.inputWrapper}>
<Input
onFocus={(event) => {
this._scrollToInput(findNodeHandle(event.target));
}}
inputContainerStyle={styles.inputContainer}
onChangeText={this.props.setDiscount}
inputStyle={styles.input}
errorStyle={{ color: COLORS.RED }}
errorMessage={this.props.discountError ? 'Coupon is not exists or expired' : ''}
/>
</View>
<TouchableOpacity onPress={() => this.applyDiscount()} style={styles.applyButton}>
<Text style={styles.applyButtonText}>Apply</Text>
</TouchableOpacity>
</View>
);
_scrollToInput(reactNode) {
this.scroll.props.scrollToFocusedInput(reactNode);
}
this.scroll=scroll}
内容容器样式={{
对齐自我:“中心”,
对齐项目:“居中”,
宽度:“100%”
}}
风格={{
高度:“100%”,
背景颜色:COLORS.LIST\u背景
}}
数据={this.props.cartItems.list}
keyExtractor={(项,索引)=>`${item.ID}`}
ListFooterComponent={this.renderFooterComponent()}
renderItem={this.renderStudent}
/>
RenderDiscontinput=()=>(
{
这个._scrollToInput(findNodeHandle(event.target));
}}
inputContainerStyle={styles.inputContainer}
onChangeText={this.props.setDiscount}
inputStyle={styles.input}
errorStyle={{color:COLORS.RED}}
errorMessage={this.props.discountError?'优惠券不存在或已过期':''}
/>
this.applyDiscount()}style={styles.applyButton}>
申请
);
_滚动输入(反应节点){
this.scroll.props.scrollToFocusedInput(reactNode);
}