跳到主内容
@wquguru
精选88RevenueCat 博客(RSS)产品与增长

iPhone Duo折叠屏Paywall适配:布局、SDK与代码实现

How to make your paywall iPhone Duo-ready: latest advice

原文
发到 X
推荐理由

针对即将发布的iPhone Duo,给出了从环境配置到具体SwiftUI代码的完整适配方案,开发者可直接照做优化付费墙体验。

Last updated: September 28, 2026. This is a living guide — we'll keep updating it as Apple shares more and we ship new RevenueCat Paywalls features for foldables. So bookmark this and check back.

最后更新:2026年9月28日。这是一份持续更新的指南——随着苹果分享更多信息以及我们推出适用于折叠屏的新 RevenueCat Paywalls 功能,我们将不断对其进行更新。因此,请将此页加入书签并定期回来查看。

iPhone Duo gives your app two very different screens to lay out for, plus everything in between. And your paywall is the one screen where something looking ‘a little off’ costs you real money.

iPhone Duo 为你的应用提供了两个截然不同的屏幕进行布局设计,以及介于两者之间的各种形态。而你的付费墙(paywall)是唯一一个看起来“有点不对劲”就会让你损失真金白银的界面。

A paywall is already one of the hardest screens to get right on a normal iPhone. Now the same paywall has to work on a 5.4-inch outer screen, a 7.6-inch inner screen, sideways, half-folded on a table, and in Split View next to another app. If you present your PaywallView in a .sheet like most of us do today, it'll show up in every one of those states, so we want to make sure that everything still looks intentional.

在普通的 iPhone 上,付费墙已经是很难完美呈现的界面之一了。现在,同一个付费墙必须能在 5.4 英寸的外屏、7.6 英寸的内屏、横向放置、半折叠放在桌面上,以及与另一个应用并列的 Split View(分屏视图)中正常工作。如果你像大多数人今天所做的那样,以 .sheet 形式展示你的 PaywallView,它将在所有这些状态下显示,因此我们要确保一切看起来都是经过精心设计的。

This guide covers what iPhone Duo is, and what each posture does to your paywall. Plus, what Apple recommends, and exactly how to set up a RevenueCat paywall so it feels native on Duo starting today.

本指南介绍了什么是 iPhone Duo,以及每种形态对你的付费墙产生的影响。此外,还包括苹果的建议,以及如何精确设置 RevenueCat 付费墙,使其从今天起在 Duo 设备上呈现出原生般的体验。

What is iPhone Duo?

什么是 iPhone Duo?

iPhone Duo is Apple's first foldable iPhone. It has a shape like a passport and opens like a book to about the size of an iPad Mini.

iPhone Duo 是苹果首款可折叠 iPhone。它的形状类似护照,打开后像一本书一样,大小接近 iPad Mini。

Pre-orders open Friday October 16, 2026, and iPhone Duo is available starting Friday October 23, 2026. It will be available with iOS 27.1. You can test it today with the iPhone Duo simulator in the Xcode 27.1 beta (get it at Apple Developer).

预购将于 2026 年 10 月 16 日星期五开放,iPhone Duo 将于 2026 年 10 月 23 日星期五正式发售。它将搭载 iOS 27.1 系统。你今天就可以通过 Xcode 27.1 beta 中的 iPhone Duo 模拟器进行测试(前往 Apple Developer 获取)。

The simplest way to think about it: closed, it's an iPhone; open, it's much closer to an iPad. Apple's Human Interface Guidelines (HIG) ask you to design for two sizes: compact width on the outside and regular width on the inside.

最简单的理解方式:合上是 iPhone,打开则更接近 iPad。苹果的《人机交互指南》(HIG)要求你针对两种尺寸进行设计:外屏采用紧凑宽度(compact width),内屏采用常规宽度(regular width)。

Lots of different postures

多种不同的形态

This is where things start to get really interesting...

事情从这里开始变得非常有趣……

iPhone Duo can be closed, fully open, or angled somewhere in between. Apple's hinge API (onHingeChange in SwiftUI, UIHingeInteraction in UIKit) reports these as .closed, .partiallyOpen, or .fullyOpen. On top of that come portrait, landscape, and a few ways to set the phone down.

iPhone Duo 可以处于闭合、完全展开或介于两者之间的角度状态。苹果的铰链 API(SwiftUI 中的 onHingeChange,UIKit 中的 UIHingeInteraction)将这些状态报告为 .closed(闭合)、.partiallyOpen(部分打开)或 .fullyOpen(完全打开)。在此基础上,还有竖屏、横屏以及几种将手机放置的方式。

Using the right Xcode Beta

使用正确的 Xcode Beta 版本

One detail that's easy to miss: how your app behaves on Duo depends on which SDK you build with.

一个容易被忽略的细节:你的应用在 Duo 上的行为取决于你使用的 SDK。

  • Built before the iOS 27 SDK: your app stays out of the status bar and camera area when closed, and runs at a familiar phone size when open
  • Built with the iOS 27 SDK: your app extends to the left of the status-bar area on the inner display
  • Built with the iOS 27.1 SDK: your app goes fully edge to edge, and system bars lay out vertically
  • 基于 iOS 27 SDK 之前版本构建的应用:在闭合状态下,应用会避开状态栏和摄像头区域;在打开状态下,以熟悉的手机尺寸运行。
  • 基于 iOS 27 SDK 构建的应用:应用在内屏上会延伸至状态栏区域的左侧。
  • 基于 iOS 27.1 SDK 构建的应用:应用实现全屏边缘到边缘显示,系统栏垂直布局。

If you want your paywall to look native, build with Xcode 27.1 and test in the Duo simulator. Otherwise people who just spent $1,999 on a phone won't see your app use the whole screen.

如果你想让你的付费墙看起来原生,请使用 Xcode 27.1 构建并在 Duo 模拟器中测试。否则,那些刚花 1,999 美元买手机的人将看不到你的应用使用整个屏幕。

Official Apple recommendations for paywalls on iPhone Duo

Apple 针对 iPhone Duo 上付费墙的官方建议

Apple published a new HIG page for iPhone Duo and a set of tech talks alongside it. None of it is written specifically for paywalls or StoreKit, but a handful of the general rules map directly onto how a paywall should behave.

Apple 发布了针对 iPhone Duo 的新 HIG 页面以及一系列技术讲座。这些内容并非专门针对付费墙或 StoreKit 编写,但其中一些通用规则直接映射到付费墙应有的行为方式。

Prioritize small adjustments over big rearrangements

优先考虑小幅调整而非大幅重新布局

Apple asks you to "avoid extreme layout changes as people fold the device" and to "maintain the same functionality across device poses". For a paywall, that means the same packages, prices, trial terms, and call to action whether the phone is open or closed.

Apple 要求你“避免在设备折叠时出现极端的布局变化”,并“在不同设备姿态下保持相同的功能”。对于付费墙而言,这意味着无论手机是打开还是关闭状态,都应显示相同的套餐、价格、试用条款和行动号召。

Put Close where people now expect it

将关闭按钮放在用户现在期望的位置

On Duo, toolbars move to a vertical strip on the side. Apple says to reserve the top of that vertical axis for navigation controls like Back or Close. A RevenueCat paywall's close button is a component inside the paywall itself, so it doesn't move with the toolbar. Step 4 below covers the fix.

在 Duo 上,工具栏会移动到侧边的垂直条带中。Apple 表示应将垂直轴顶部保留给返回或关闭等导航控件。RevenueCat 付费墙的关闭按钮是付费墙内部的一个组件,因此它不会随工具栏移动。下面的第 4 步涵盖了修复方法。

Keep anything tappable off the fold

确保所有可点击元素避开折痕区域

When the device is partially folded, iOS slides sheets out of the fold for you, so a paywall presented in a sheet is covered. If you present your paywall full screen, the fold runs right through the middle of it. In that case, Apple suggests an even number of columns so nothing straddles the fold — so two package cards side by side work better than three.

当设备部分折叠时,iOS 会自动将工作表从折痕处滑出,因此以工作表形式展示的付费墙会被遮挡。如果你全屏展示付费墙,折痕会正好穿过其中心。在这种情况下,Apple 建议使用偶数列,以避免任何内容跨越折痕——因此两个并排的套餐卡片比三个效果更好。

Know where your sheet will land

了解你的工作表将落在何处

On the inner display, sheets are centered by default. You can move one to the leading or trailing edge with presentationPlacement(_:). On the outer display, a sheet with a single button can opt out of the vertical bar and stop just short of the camera.

在内屏上,工作表默认居中。你可以使用 presentationPlacement(_: ) 将其移至起始边缘或末尾边缘。在外屏上,包含单个按钮的工作表可以选择退出垂直条带,并在摄像头下方停止。

Adapting your existing paywall for iPhone Duo

为 iPhone Duo 适配现有付费墙

You don't need to wait for anything new to get a good result on Duo. Here's the setup I'd use, built entirely on features that are live in RevenueCat Paywalls right now.

你无需等待新功能即可在 Duo 上获得良好效果。以下是我会采用的设置方案,完全基于 RevenueCat Paywalls 当前已上线的功能构建。

1. Preview your paywall on iPhone Duo in the paywall editor

1. 在付费墙编辑器中预览 iPhone Duo 上的付费墙

The RevenueCat paywall editor now includes an iPhone Duo preview. You can switch between open and closed, portrait and landscape. The preview matches the Duo's screen shape, safe areas, and camera, and it shows what the current SDKs render. It's the fastest way to spot problems before you open Xcode.

RevenueCat 付费墙编辑器现已支持 iPhone Duo 预览。你可以在打开和关闭、竖屏和横屏之间切换。预览界面匹配 Duo 的屏幕形状、安全区域和摄像头,并显示当前 SDK 渲染的效果。这是在打开 Xcode 之前快速发现问题最快的方法。

2. Build with Xcode 27.1 and open the Duo simulator

2. 使用 Xcode 27.1 构建并打开 Duo 模拟器

Install the Xcode 27.1 beta, choose iPhone Duo in Device Hub, and use the controls at the bottom of the simulator to open, close, rotate, and fold it. Walk your paywall through every posture in the table above before you change anything, so you know what you're actually fixing.

安装 Xcode 27.1 beta 版本,在 Device Hub 中选择 iPhone Duo,并使用模拟器底部的控件来打开、关闭、旋转和折叠设备。在更改任何内容之前,请按照上述表格中的每种姿态测试你的付费墙,以便清楚你实际修复的问题。

Get the versions exactly right

确保版本号完全正确

You need the Xcode 27.1 beta specifically, not Xcode 27.2. Your simulator has to run iOS 27.1 too, not iOS 27 or iOS 27.2. I learned this one while setting up my own test project, so double-check both before you start.

你必须使用特定的 Xcode 27.1 beta 版本,而不是 Xcode 27.2。你的模拟器也必须运行 iOS 27.1,而不能是 iOS 27 或 iOS 27.2。我在设置自己的测试项目时学到了这一点,所以在开始之前请双重检查两者。

3. Present your paywall in a sheet

3. 以 Sheet 形式展示付费墙

A sheet does a lot of Duo work for you. On the inner display, the system centers it by default. When the device is partially folded, the sheet slides away from the fold on its own.

Sheet 为你处理了许多 Duo 相关的工作。在内屏上,系统默认将其居中显示。当设备部分折叠时,Sheet 会自动远离折痕滑动。

The simplest option is RevenueCat's presentPaywallIfNeeded modifier. It checks the entitlement for you, presents the paywall in a sheet, and dismisses it once the entitlement is active. On iPad, it shows the paywall in a modal that's roughly iPhone-sized.

最简单的选项是使用 RevenueCat 的 presentPaywallIfNeeded 修饰符。它会自动检查权限,以 Sheet 形式展示付费墙,并在权限激活后自动关闭。在 iPad 上,它以大约 iPhone 大小的模态窗口显示付费墙。

If you want more control, present PaywallView yourself in a .sheet. That's the route to take if you want a native Close button in the toolbar, which is the next step.

如果你希望拥有更多控制权,可以在 .sheet 中自行呈现 PaywallView。如果你想让工具栏中包含原生的关闭按钮(这是下一步),就应该选择这种方式。

4. Move close into the system toolbar

4. 将关闭按钮移至系统工具栏

If you present PaywallView yourself, move the X out of the paywall and into the system toolbar. Wrap PaywallView in a NavigationStack and add a close button with the .cancellationAction placement, which is what Apple recommends for custom close buttons. iOS then puts it at the top of the vertical bar on the outer display, and in the usual corner on the inner display.

如果你自行呈现 PaywallView,请将 X 关闭按钮从付费墙内部移出,放到系统工具栏中。将 PaywallView 包裹在 NavigationStack 中,并添加一个使用 .cancellationAction 放置位置的关闭按钮,这是 Apple 为自定义关闭按钮所推荐的做法。iOS 随后会在外屏的垂直条顶部放置该按钮,并在内屏的常规角落位置放置。

代码 · 19 行
import SwiftUI
import RevenueCatUI
struct PaywallSheet: View {
    @Environment(\.dismiss) private var dismiss
    var body: some View {
        NavigationStack {
            PaywallView()
                .toolbar {
                    ToolbarItem(placement: .cancellationAction) {
                        Button("Close", systemImage: "xmark") {
                            dismiss()
                        }
                    }
                }
        }
    }
}
// Present it from your app:
// .sheet(isPresented: $showPaywall) { PaywallSheet() }

Then remove the close button from your paywall in the editor, so people don't see two. Close buttons are an optional component in RevenueCat Paywalls, and RevenueCat's docs note that sheets don't require a dedicated close button. If you also show the same paywall somewhere else without a toolbar, remember it won't have a close button there either.

然后在编辑器中移除付费墙内的关闭按钮,以免用户看到两个关闭按钮。关闭按钮是 RevenueCat Paywalls 中的可选组件,RevenueCat 的文档指出 Sheet 不需要专用的关闭按钮。如果你还在没有工具栏的其他地方展示相同的付费墙,请记住那里也不会有关闭按钮。

Using presentPaywallIfNeeded instead? The modifier presents its own sheet, so there's no toolbar to add a button to. Your paywall's built-in close button is what people see. On the outer display the camera sits in the top-trailing corner, so check that your X doesn't end up right next to it. The Duo preview in the paywall editor shows exactly where it lands.

使用的是 presentPaywallIfNeeded 吗?该修饰符会呈现自己的 Sheet,因此没有工具栏可以添加按钮。用户看到的是付费墙内置的关闭按钮。在外屏上,摄像头位于右上角,因此请检查你的 X 关闭按钮是否恰好位于其旁边。付费墙编辑器中的 Duo 预览会准确显示其位置。

5. Run the checklist

5. 运行检查清单

Before you ship, walk your paywall through every posture and check:

在发布之前,请按每种姿态遍历你的付费墙并检查:

  • Close is reachable and doesn't collide with the camera or the side bar
  • 关闭按钮可触及,且不与摄像头或侧边栏冲突

更进一步:量化金融体系

看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力

进入量化体系 →

相似阅读

关联信息,但可能不是同一事件