nativescript - Create NativeScript Modal View without outlined whitespace?
问题描述
I have an Angular NativeScript project and I am trying to create a modal view that does not cover the full screen and has a semi-transparent background. What I am trying to achieve works properly on iPad, but on iPhones a white outline appears and the page zooms out when a modal view is clicked. I would like to replicate the functionality of the iPad on the iPhone.
解决方案
You could override the default presentation style to OverFullScreen
which prevents the shrink animation.
const options: ModalDialogOptions = {
viewContainerRef: this.viewContainerRef,
fullscreen: false,
ios: {
presentationStyle: UIModalPresentationStyle.OverFullScreen
},
context: {}
};
this.modalService.showModal(ModalComponent, options);
If you haven't installed tns-platform-declarations
, you may have to declare UIModalPresentationStyle
to avoid TS errors
declare var UIModalPresentationStyle;
推荐阅读
- ruby-on-rails - 如何在rails中创建部分表单以使用ajax删除和更新记录
- arduino - Arduino - 使用 MKS V1.5 板控制电机
- vba - VBA 中的类型 13 数据不匹配错误
- machine-learning - 卷积神经网络在二值图像上运行得更快吗
- javascript - 外部文件中的jQuery不起作用
- javascript - 选择 datalist item 后,下拉列表仍然存在。我怎样才能确保它消失?
- javascript - 如何使用来自 div 数据属性的数据在 JavaScript 中将字符串转换为对象?
- javascript - 如何使用 Mobx 状态管理库将 RTCPeerConnection 更改传播到 React 组件
- jcombobox - JComboBox 循环向上向下箭头键
- javascript - 从 json 获取准确数据以做出反应