1
목록의 마지막 항목을 볼 수 없음 그것을보기 위해 꼭대기에 오르십시오. 이 화면은 헤더가있는 stackNavigator 내에 있습니다. 그것이 문제일까요? 그것을 해결하는 방법?그러나, 나는 마지막 항목은 항상 조금 떨어져 있음을 발견했습니다, 나는 사람들의 목록을 볼 수 FlatList을 사용하고
나는 FlatList에서 marginBottom : 40을 시도했지만 아무 것도 변경하지 않았습니다.
코드 : paddingBottom (또는 위)와
let renderRow = ({item}) => {
return (
<View style={{flexDirection: "row", justifyContent: "space-between"}}>
<TouchableOpacity style={{ flexDirection: "row", justifyContent: "flex-start", marginLeft: 10}} onPress={this.myFunction.bind(this, item)} >
<View style={{}}>
<Image style={styles.Image} source={{uri: item.Image}} />
</View>
<View style={{ marginTop: 15, marginLeft: 10}}>
<Text >{item.name}</Text>
</View>
</TouchableOpacity>
</View>
);
}
return(
<FlatList style={{marginTop: 10, backgroundColor: "white"}}
keyExtractor={(item, index) => item.id}
data={this.state.result}
renderItem={renderRow.bind(this)}
ItemSeparatorComponent={renderSeparator.bind(this)}
/>
)
, 지금은 마지막 두 항목이 표시되지 않습니다 :
내 디자인에 따라 'marginBottom : 120'을 설정하여 수정되었습니다. 감사합니다 –
더 나은 접근 방식은 FlatList에 스타일로'flex : 1'을주는 것입니다. 이렇게하면 목록에서 개별 요소의 여백 안쪽 여백을 수동으로 설정하는 대신 사용 가능한 전체 너비 높이의 화면을 차지할 수 있습니다. –