如何在SwiftUI中使用超链接实现本地化文本

问题描述

我有如下内容。我想通过Localization字符串实现它。

import SwiftUI

struct ContentView: View {
    var body: some View {
        vstack {
            Text("By signing in,you agree to the ")
            HStack(spacing: 0) {
                Button("privacy policy") {}
                Text(" and ")
                Button("terms of service") {}
                Text(".")
            }
        }
    }
}

有没有办法像这样实现它?

"bySignIn %@ and %@." = "By signing in,you agree to the %@ and %@.";

OR

"bySignIn %@ and %@." = "By signing in,you agree to the Button(%@) and Button(%@).";

您对此有何建议?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)