wix-react-native-navigation - react-native-navigation showModal 自定义大小
问题描述
我使用 wix react-native-navigation。Navigation.showModal 打开全屏大小。是否可以打开自定义尺寸?我在哪里可以找到有关导航布局的所有属性列表?文档太少了...
解决方案
模态总是全屏。您可以在 jsx 中控制视图的尺寸。而不是flex: 1
- 根据您的需要使用预定义的宽度和高度。
render() {
return (
<View style={{width: '80%', height: 150}}>
{ /* render Modal content */ }
</View.
);
}
或者,如果您需要与 Modal 后面的 UI 进行交互,您应该使用Navigation.showOverlay
Navigation.showOverlay({
component: {
name: 'example.Overlay',
options: {
overlay: {
interceptTouchOutside: false // this make touch events pass through the invisible parts of the overlay
}
}
}
});
有关使用的 Overlay 的更多示例,您可以在Playground 应用程序中查看代码示例
推荐阅读
- unit-testing - Karma + Jasmine + Durandal + KnockoutJS + RequireJS 单元测试中不匹配的匿名 define() 模块
- swift - *** 由于未捕获的异常“NSInternalInconsistencyException”而终止应用程序,原因:“线程违规:预期主线程”
- python - 将 CSV 文件中的值读入二维数组
- pandas - 如何从当前日期中减去天数并在熊猫中返回日期对象
- regex - 如何在 While If 语句中使用正则表达式?Perl
- azure-devops - 在管道的发布阶段强制数据播种
- java - 我在 Java 中做错了什么?
- c++ - 如果在 constexpr 上下文中,如何在 assert() 和 static_assert() 之间分派,依赖?
- android - 我们如何在三星平板电脑中设置信息亭模式?
- javascript - 使用 JavaScript 中的正则表达式在 jstree 中选择一个节点