简体   繁体   中英

Change Text link color swiftUI

I have the folowing Text() that takes markdown to show a link

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 .

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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