Monday, July 22, 2024
HomeiOS Developmentios - In SwiftUI, I can not change the placeholder textual content...

ios – In SwiftUI, I can not change the placeholder textual content coloration of a TextField if the textual content is a hyperlink


The TextField initialiser is likely to be utilizing this Textual content initialiser beneath the hood to create the label. This detects markdown and renders it as such. You must use TextField.init(textual content:label:) that lets you move in any View as a label as an alternative. Then you should use Textual content.init(verbatim:) to power it to not deal with the textual content as markdown.

TextField(textual content: $textual content) {
    Textual content(verbatim: "www.instance.com")
}

Alternatively, you should use backslashes to flee the dots within the URL, so SwiftUI not detects it as a URL.

TextField("www.instance.com", textual content: $textual content)

Different options right here may additionally work.



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments