0
コンテンツに合わせてモーダルの高さを変更したいと思います。それは、常にちょうど画面の高さに行く:反応したネイティブのコンテンツにフィットするストレッチの高さ
JSX:
<Modal style={styles.modal}
isVisible={props.categories.some(x => showModal(x))}>
<Container style={styles.modalView}>
<Header style={styles.header}>
<Left>
<Title
style={styles.title}>{getDisplayedCategoryLabel(props.categories)}
</Title>
</Left>
<Right>
<Button
small
transparent
danger
rounded
icon
onPress={() => props.setAllShowSubcategoriesToFalse()}>
<Icon name="times" size={20} color='#9E9E9E' />
</Button>
</Right>
</Header>
<Content >
<SelectMultiple
labelStyle={styles.label}
items={getDisplaySubcategories(props.categories)}
selectedItems={
props.categories.filter(category => category.selected)
}
onSelectionsChange={props.toggleSubcategory} />
</Content>
</Container>
</Modal>
スタイル:modal
スタイルの高さを変更する
const styles = {
modalView: {
flex: 1,
backgroundColor: '#FFFFFF',
padding: 20,
borderRadius: 8,
height: 100
},
modal: {
padding: 10,
height: 100
}
}
は何もしません。私は身長を全く変えていないようです。高さに影響を与えるにはどうしたらいいですか?
私は、これは単なる推測が、方法についてはあなたがpaddingTop
に0
の値を与え、それがうまくいく方法を見ているreact-native-modal