UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

SOLVED: Image needs to be centered to text level

Forums > SwiftUI

My Issue to have the Image Centered to text, Click on my link here

 VStack {
  HStack {
      Image(systemName: self.imageName )
       .font(.system(size: 10))
       .foregroundColor(self.pressed ? forgroundPressedOn : forgroundPressedOff)

       Text(story.event)
       .foregroundColor(self.pressedTextOn ? storyTextOn : Color(.lightText))

                    }

                }

2      

There is not wrong with the centering. Once I use the Capitol Letter instead of lower case. The rectangle is centered.

I will create a Class that will check for the first letter and if it is in the lower case, I will convert it to its Upcase. Problem solved.

2      

TAKE YOUR SKILLS TO THE NEXT LEVEL If you like Hacking with Swift, you'll love Hacking with Swift+ – it's my premium service where you can learn advanced Swift and SwiftUI, functional programming, algorithms, and more. Plus it comes with stacks of benefits, including monthly live streams, downloadable projects, a 20% discount on all books, and free gifts!

Find out more

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.