NEW: Subscribe to Hacking with Swift+ and accelerate your learning! >>

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)

       .foregroundColor(self.pressedTextOn ? storyTextOn : Color(.lightText))




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.


Hacking with Swift is sponsored by NSSpain

SPONSORED Announcing NSSpain 2020: Remote Edition! An online, continuous conference for iOS developers. We’ll start on Thursday and finish on Friday, with talks, activities, and lots of fun for 36 hours, non-stop. Sound good? Join us!

Find out more

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

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

Unknown user

Not logged in

Log in

Link copied to your pasteboard.