Skip to content

05 · Dynamic Island & Fullscreen Safe Area Adaptation

Prevents UI clipping caused by the iPhone Dynamic Island, camera notches, bottom Home Bar, and the Telegram native top header bar.


Implementation Tracks

Track A — Prefab Workflow

  1. Open the 05_SafeArea_Demo scene.
  2. Drag FastTMA_SafeAreaContainer from Packages/com.fasttma.core/Runtime/Prefabs/ into the root of Canvas.
  3. Place all in-game UI interfaces that need obstruction prevention inside this container:
    • Action buttons
    • Top score bars
    • Popups and dialogs

The container comes pre-configured with TelegramSafeArea, which automatically contracts margins at runtime based on hardware insets.


Track B — Non-Invasive Component Attachment

  1. Select the top-level fullscreen UI root panel in your commercial project (e.g., UIRootPanel).
  2. Click Add Component → TelegramSafeArea.
  3. Keep "Enable Top Safe Area" and "Enable Bottom Safe Area" checked in the Inspector.

Technical Details: The component dynamically updates RectTransform margins in LateUpdate with zero GC allocations, seamlessly adapting to:

  • Screen orientation changes
  • Dynamic Island insets
  • Telegram client header height variations

Demo Reference

See Packages/com.fasttma.core/Samples/05_SafeArea for the full Demo implementation.