You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何消除Telegram小程序在iPhone上的底部间隙

解决Telegram小程序在iPhone上的底部间隙问题(基于Taiga UI开发)

以下是针对iPhone设备底部间隙问题的具体解决步骤:

  • 修正视口Meta标签
    确保HTML头部的视口配置包含viewport-fit=cover,让页面内容能覆盖整个屏幕(包括iPhone的底部安全区):

    <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
    
  • 适配底部安全区
    用CSS的env(safe-area-inset-bottom)变量给页面底部的固定元素(比如Taiga UI的底部面板、导航栏)添加内边距,消除间隙同时避免内容被安全区遮挡:

    /* 针对Taiga UI底部组件 */
    .tui-sheet__footer, .tui-bottom-navigation {
        padding-bottom: env(safe-area-inset-bottom);
    }
    /* 自定义底部容器的情况 */
    .fixed-bottom-element {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding-bottom: env(safe-area-inset-bottom);
    }
    
  • 调整Taiga UI组件样式
    部分Taiga UI组件自带默认底部间距,需要覆盖样式。比如TuiBottomSheet,可以用样式穿透(Angular中用::ng-deep)调整:

    :host ::ng-deep .tui-bottom-sheet__content {
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
    }
    
  • 检查Telegram小程序配置
    确认小程序配置文件(如manifest.json)中开启了全屏适配相关设置,保证WebView能正确适配设备屏幕。

应用界面:
应用界面

底部问题区域:
底部问题区域

内容的提问来源于stack exchange,提问作者Alexander Mashin

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.18 21:33:15