我正在尝试使用以下模块在我的react本机应用程序中显示一个弹出:
https://github.com/jacklam718/react-native-popup-dialog
但是,我希望弹出窗口只出现在屏幕的底部。我在popupStyle中尝试过各种方法,但是弹出窗口的位置始终保持在中心位置。是否可以将其位置更改为仅显示在屏幕底部。
index.js
import PopupDialog, { SlideAnimation, DialogTitle } from 'react-native-popup-dialog';
import { styles } from './styles';
....
<PopupDialog
ref={(popupDialog) => { this.popupDialog = popupDialog; }}
style={styles.popupDialogStyle}
dialogAnimation={slideAnimation}
height={150}
dialogTitle={<DialogTitle title="Select options" />}
>
styles.js
export const styles = StyleSheet.create({
popupDialogStyle: {
backgroundColor: 'lightgray',
marginTop: 100,
},
});
发布于 2018-03-15 10:04:20
根据问题89:如何定位绝对,您需要使用
<PopupDialog
containerStyle={{ justifyContent: 'flex-end' }}
/>
或
<PopupDialog
dialogStyle={{ position: 'absolute', bottom: 0 }}
/>
https://stackoverflow.com/questions/49295862
复制相似问题