I’m trying to put a list at the top of a tab. But when I use this code, the list stays in the center of the screen…..
I tried using padding but that didn’t work.
I tried using ‘Alignment(horizontal: .center, vertical: .top)’ but that didn’t work.
I even tried pretending that it worked but that also didn’t work.
So, what WILL work?
Thank you for any assistance
Swift:
TabView {
VStack
{
List(names, id: \.self, selection: $selection)
{
name in
Text(name)
}
.frame(width: 600, height: 100, alignment: .top)
}
.tabItem
{
Image(systemName: "1.square.fill")
Text("Tab 1")
}
}
I tried using ‘Alignment(horizontal: .center, vertical: .top)’ but that didn’t work.
I even tried pretending that it worked but that also didn’t work.
So, what WILL work?
Thank you for any assistance