> ## Documentation Index
> Fetch the complete documentation index at: https://docs.y.uno/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Test in the sandbox first: base URL https://api-sandbox.y.uno (Test Mode in the Dashboard). Production is https://api.y.uno (Live Mode).
> Every API request needs the public-api-key and private-secret-key headers. Get them in the Dashboard at https://dashboard.y.uno/developers (Developers > Credentials); sandbox and production keys are different.
> Send an X-Idempotency-Key (a UUID) when creating payments, refunds and cancels, so retries do not create duplicates.
> Start with the Quickstart (https://docs.y.uno/docs/quickstart.md) and the agent guide (https://docs.y.uno/agents.md). To search these docs from a coding agent, connect the docs MCP server at https://docs.y.uno/mcp.

# iOS 样式

> 自定义 iOS SDK 的外观，包括字体、颜色和按钮样式，使其与您的品牌保持一致

> [!NOTE]
>
> **This page documents a legacy SDK.** Starting a new integration? Use the [Yuno SDK](https://docs.y.uno/docs/yuno-sdk/get-started.md). Already on a legacy SDK? Follow the [migration guide](https://docs.y.uno/docs/yuno-sdk/migration/overview.md).
>
> The new **Yuno SDK** (Web v2.x, iOS v3.x, Android v3.x, React Native v2.x) replaces the Full, Lite, Seamless, Render, Headless, and Secure Fields SDKs with one API across every platform. Legacy SDKs remain supported side by side during the transition and are scheduled for deprecation in **2027**. Contact your Account Manager for migration planning.

通过设置外观字段来修改 Yuno iOS SDK 的样式（字体、按钮、颜色）。使用这些字段可以匹配您的应用品牌并提升一致性。如需了解所有 iOS SDK 参数和配置选项，请参阅 [iOS SDK 通用参考](https://docs.y.uno/zh-hans/docs/sdks/resources/references/ios.md)。

## 外观配置

可用的自定义字段：

| 字段 | 描述 |
| - | - |
| `fontFamily` | 指定 SDK 中使用的字体系列。请提供您应用中使用的字体文件名，并确保其与您应用的资源一致。 |
| `accentColor` | 定义多个 SDK 元素中使用的强调色。 |
| `buttonBackgroundColor` | 设置主要按钮的背景颜色。 |
| `buttonTitleColor` | 确定主要按钮的文本颜色。 |
| `buttonBorderColor` | 指定主要按钮的边框颜色。 |
| `secondaryButtonBackgroundColor` | 设置次要按钮的背景颜色。 |
| `secondaryButtonTitleColor` | 确定次要按钮的文本颜色。 |
| `secondaryButtonBorderColor` | 指定次要按钮的边框颜色。 |
| `disableButtonBackgroundColor` | 设置已禁用按钮的背景颜色。 |
| `disableButtonTitleColor` | 确定已禁用按钮的文本颜色。 |

> [!NOTE]
>
> **颜色配置**
>
> 请确保所有颜色都以 UIColor 指定，以保持兼容性。颜色可以来自 Xcode 的预定义调色板或商户的资源，但类型必须始终为 UIColor。

使用 `Yuno.Appearance()` 函数定义一个包含所有自定义设置的变量，以控制外观。然后在初始化 SDK 时传入该变量：

```swift theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
let appearance = Yuno.Appearance(
    fontFamily: "Climate Crisis",
    accentColor: UIColor.orange, 
    buttonBackgroundColor: UIColor.yellow, 
    buttonTitleColor: UIColor.black, 
    buttonBorderColor: UIColor.black,
    secondaryButtonBackgroundColor: UIColor.yellow,
    secondaryButtonTitleColor: UIColor.black,
    secondaryButtonBorderColor: UIColor.black,
    disableButtonBackgroundColor: UIColor.gray,
    disableButtonTitleColor: UIColor.black
)

Yuno.initialize(
    apiKey: apiKey,
    config: YunoConfig(appearance: appearance)
)

```

### 使用示例

示例（两种外观自定义）：

```swift Example 1 (left) theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
let appearance = Yuno.Appearance(
    fontFamily: "Climate Crisis",
    accentColor: UIColor.black, 
    buttonBackgroundColor: UIColor.black, 
    buttonTitleColor: UIColor.white
)

Yuno.initialize(
    apiKey: apiKey,
    config: YunoConfig(appearance: appearance)
)

```

```swift Example 2 (right) theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
let appearance = Yuno.Appearance(
    fontFamily: "Climate Crisis",
    accentColor: UIColor.orange, 
    buttonBackgroundColor: UIColor.orange, 
    buttonTitleColor: UIColor.white
)

Yuno.initialize(
    apiKey: apiKey,
    config: YunoConfig(appearance: appearance)
)

```

两个使用不同强调色的 checkout 页面示例

## 地址自动补全

商户可以在 iOS SDK 中开启或关闭地址自动补全功能。开启时，SDK 会根据邮政编码查询自动填写地址字段。关闭时，用户必须手动输入所有地址信息。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.