For AI agents: the complete documentation index is available at /next/zh/llms.txt, the full documentation bundle is available at /next/zh/llms-full.txt, and this page is available as Markdown at /next/zh/api/lynx-native-api/template-bundle/from-template.md.
Lynx
  • 简体中文
  • fromTemplate

    输入 Lynx 模板二进制内容,返回解析后的 TemplateBundle 对象。

    语法

    Android

    public static TemplateBundle fromTemplate(byte[] template);

    参数说明

    • template: 模板二进制内容。

    返回值

    • TemplateBundle 对象。
    Note
    • 当输入的 templatenull 时,此方法直接返回 null
    • 当输入的 template 不是正确的 Lynx 模板数据时,将返回一个无效的 TemplateBundle

    iOS

    - (instancetype _Nullable)initWithTemplate:(nonnull NSData *)tem;

    参数说明

    • tem: 模板二进制内容。

    返回值

    • TemplateBundle 对象。
    Note
    • 当输入的 tem 不是正确的 Lynx 模板数据或为 nil 时,将返回一个无效的 TemplateBundle

    Harmony

    public static async fromTemplate(template: ArrayBuffer): Promise<TemplateBundle>;

    参数说明

    • template: 模板二进制内容。

    返回值

    • Promise 形式的 TemplateBundle。

    兼容性

    LCD tables only load in the browser

    除非另有说明,本项目采用知识共享署名 4.0 国际许可协议进行许可,代码示例采用 Apache License 2.0 许可协议进行许可。