【发布时间】:2021-10-01 16:31:59
【问题描述】:
我在 iOS 模拟器中遇到了一个奇怪的问题,特别是在 iPhone 12 pro max 模拟器中。 You can get the video from this link
请观看此视频,因为它在 iPhone 8 中运行良好,但在 iPhone 12 max pro 中不适用,但我想说它在 iPhone 11 中也不起作用。它在 Android 设备上运行良好。
以下是我正在使用的代码:
// SizedBox(
// height: sizedHeight,
// ),
Hero(
tag: 'mannafy_logo',
child: Material(
child: GestureDetector(
child: Image.asset(
"assets/images/mannafy_logo.png",
width: 125,
fit: BoxFit.fitWidth),
onTap: () async {
const url = 'https://www.mannafy.com';
if (await canLaunch(url)) {
await launch(url);
} else {
throw 'Could not launch $url';
}
},
),
),
),
现在最奇怪的部分出现了,如果您取消注释 SizedBox 代码,它会开始正常工作,但我不想在该图像上方添加空间。
请帮忙解决这个问题。
谢谢
【问题讨论】:
-
试着把它包装成
SafeArea,也许会有帮助。 -
我已经在 SafeArea 中进行了包装,但我的图像上方仍有空间。
标签: android ios flutter dart hybrid-mobile-app