简体   繁体   English

更改文本链接颜色 swiftUI

[英]Change Text link color swiftUI

I have the folowing Text() that takes markdown to show a link我有以下Text()需要 markdown 来显示链接

Text(.init("[Link Example](https://www.google.es/)"))

我的文字示例

Is there a way of changing the default color set to the link?有没有办法更改链接的默认颜色设置?

It is possible to use accent color, like可以使用强调色,例如

Text(.init("[Link Example](https://www.google.es/)"))
    .accentColor(.red)

You can achieve that with .tint(_:) as accentColor(_:) will soon be deprecated according to the documentation .您可以使用.tint(_:)来实现这一点,因为根据文档accentColor(_:)很快就会被弃用。

Text("[Link Example](https://www.google.es/)")
  .tint(Color.red)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM