Relative Content

Tag Archive for swiftswiftuitext

Add padding to text background color

I want to make the text appear “highlighted” but not the whole text box. I’d like for each line to be individually highlighted. I’ve not found the best way to make this happen. The only thing I can think of is to use the same text from my variable, putting a background color on it, lower the font to where it makes a gap and make the text color clear… if that makes sense. Here is what I’m wanting. I’m using SwiftUI.

SwiftUI Add padding to text background color

I’m wanting to make the text appear “highlighted” but not the whole text box. I’d like for each line to be individually highlighted. I’ve not found the best way to make this happen. The only thing I can think of is to use the same text from my variable, putting a background color on it, lower the font to where it makes a gap and make the text color clear… if that makes sense. Here is what I’m wanting. I’m using SwiftUI.

Swiftui Modify the text itself?

I have a simple question. I m using a custom view that takes a string as its text. The texts are quite long and they have titles in them. So this titles has to be bold for example. But the values Im passing are different then each other.