ios – Combining a number of Textual content views horizontally with completely different modifiers – SwiftUI

0
7


I’m making an attempt to mix a number of Textual content views which have completely different modifiers. For instance:

Textual content("That is") +
Textual content("tap-able")
    .overlay(
        Textual content("overlayed textual content")
            .padding(.all, 10)
    ) +
Textual content("textual content")

The center Textual content view returns some View since I utilized the overlay modifier, nevertheless it can’t be mixed with the opposite views since they’re simply Textual content views. I attempted some strategies, like I wrapped the Textual content view inside AnyView to erase its sort, however + operator doesn’t work with AnyView. I additionally tried to place them in HStack, however that messes it up if I’ve longer textual content strings. What different choices can I exploit please?

LEAVE A REPLY

Please enter your comment!
Please enter your name here