Я хочу центрировать мою рамку ячейки в списке. На рисунке ниже показано, как я хочу, чтобы он выглядел следующим образом: 
Я временно использую ширину рамки для достижения sh этого результата, но это не правильный способ решить это. У кого-нибудь есть предложение, как я могу отцентрировать оранжевую рамку?
Это мой код:
var body: some View {
NavigationView {
List {
ForEach(splitArray(), id: \.self) { nieuwsItem in
NavigationLink(destination: Text(nieuwsItem.link).font(.title)) {
HStack {
VStack(alignment: .leading) {
Text(nieuwsItem.title)
.font(.headline)
.lineLimit(2)
.foregroundColor(Color(UIColor.label))
Text(nieuwsItem.description)
.font(.subheadline)
.foregroundColor(Color("textColor"))
.lineLimit(3)
}.padding(5)
}.cornerRadius(10)
}
}.frame(width: 370, height: 150, alignment: .center)
.background(Color(UIColor(#colorLiteral(red: 0.8745098039, green: 0.3411764706, blue: 0, alpha: 1))))
.cornerRadius(20)
//.padding(.bottom, 20)
}//.colorMultiply(Color("backgroundColor")).padding(.top)
.navigationBarTitle(Text("Nieuws"))
}.onAppear {
print("NieuwsView appeared!")
//splitArray()
}
}
Вот код без жестко запрограммированной рамки:
var body: some View {
NavigationView {
List {
ForEach(splitArray(), id: \.self) { nieuwsItem in
NavigationLink(destination: Text(nieuwsItem.link).font(.title)) {
HStack {
VStack(alignment: .leading) {
Text(nieuwsItem.title)
.font(.headline)
.lineLimit(2)
.foregroundColor(Color(UIColor.label))
Text(nieuwsItem.description)
.font(.subheadline)
.foregroundColor(Color("textColor"))
.lineLimit(3)
}.padding(5)
}.cornerRadius(10)
}.frame()
}.frame(width: 300, height: 150, alignment: .center)
.background(Color(UIColor(#colorLiteral(red: 0.8745098039, green: 0.3411764706, blue: 0, alpha: 1))))
.cornerRadius(20)
//.padding(.bottom, 20)
}//.colorMultiply(Color("backgroundColor")).padding(.top)
.navigationBarTitle(Text("Nieuws"))
}.onAppear {
print("NieuwsView appeared!")
//splitArray()
}
}