簡體   English   中英

更改文本鏈接顏色 swiftUI

[英]Change Text link color swiftUI

我有以下Text()需要 markdown 來顯示鏈接

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

我的文字示例

有沒有辦法更改鏈接的默認顏色設置?

可以使用強調色,例如

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

您可以使用.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