How to move objects to the right side?

Hey, I would like to move the symbols and texts to the right side

That's the code:

NavigationView {
      VStack {
        List {
          Label (
            title: { Text("tv") }, icon: { Image(systemName: "tv") }

How do you do that? Thanks in advance for the answers!

Answered by robnotyou in 703433022
  1. Set frame and alignment:
.frame(maxWidth: .infinity, alignment: .trailing)
  1. Within the List, "Group" your items, so that frame and alignment apply to them all:
NavigationView {
    VStack {
        List {
            Group {
                Label(title: { Text("tv") }, icon: { Image(systemName: "tv")})
                Label(title: { Text("another tv") }, icon: { Image(systemName: "tv")})
            }
            .frame(maxWidth: .infinity, alignment: .trailing)
        }
    }
}

Confirm the base language of the project used for localization. This should happen automatically based on your computer's or mobile device's default language, the project's default or base localization language without you having to force it.

HStack + Spacer() should work unless you have NavigationLink inside the list.

Accepted Answer
  1. Set frame and alignment:
.frame(maxWidth: .infinity, alignment: .trailing)
  1. Within the List, "Group" your items, so that frame and alignment apply to them all:
NavigationView {
    VStack {
        List {
            Group {
                Label(title: { Text("tv") }, icon: { Image(systemName: "tv")})
                Label(title: { Text("another tv") }, icon: { Image(systemName: "tv")})
            }
            .frame(maxWidth: .infinity, alignment: .trailing)
        }
    }
}
How to move objects to the right side?
 
 
Q