Pad & Foldable Adaptation

On Pad and foldable devices, Tuya miniapps may display incorrectly or become hard to operate. Completing Pad and foldable adaptation ensures a good experience on these devices.

Info

Foldable devices decide whether to treat the screen as a Pad based on screen width. If you already see Pad adaptation behavior, the device is in the adapted state.

Version Requirements

  • App baseline version: iOS / Android >=7.7.0, HarmonyOS >=1.0.24

Adaptation Steps

1. Enable App tablet adaptation

In the Tuya Developer Platform → App Development → Feature Configuration → App Advanced Features, enable Adapt to Tablets.

2. Differentiate iOS and Android

OSAction
iOSNo extra action required
AndroidEnable Tablet mode in the App Settings

3. Configure largeScreenDisplayMode

Set the largeScreenDisplayMode field in src/global.config.ts:

ValueBehaviorMiniapp requirementExampleNotes
contained or not setContent centered with side margins (9:16)No extra handling—
fullscreenFill the full screenAdapt fullscreen styles yourselfAdapt styles by screen width: when width >=600 and <920, increase font-size by +2px; when width >=920, increase font-size by +4px. Convert other rpx sizes to px with 1rpx = 0.5px (keep original px). Use @media in less / css / scss, and runtime width branches for inline / JS/TSX dynamic style.
export default {
  largeScreenDisplayMode: 'contained',
};

4. Finish adaptation

After completing the steps above, the miniapp can be used normally on Pad and foldable devices.