I want create this type of design
Added spacing parameters to HStack and VStack to ensure consistent spacing between elements.
Used .frame(maxWidth: .infinity, alignment: .leading) in the VStack to ensure it fills the available width while keeping the text aligned to the leading edge.
I tried my best but no luck
VStack(alignment:.leading) {
HStack(alignment:.top) {
Image("vodka")
.resizable()
.frame(width: 80,height: 80)
.cornerRadius(10)
VStack(alignment:.leading) {
Text(i.strURL ?? "")
.lineLimit(2)
.multilineTextAlignment(/*@START_MENU_TOKEN@*/.leading/*@END_MENU_TOKEN@*/)
Text(i.strDate ?? "")
.lineLimit(1)
.background(Color.red)
.multilineTextAlignment(/*@START_MENU_TOKEN@*/.leading/*@END_MENU_TOKEN@*/)
}
.background(Color.gray)
.frame(width: .infinity)
}
.padding(.horizontal,15)
Divider()
.frame(height: 1)
.overlay(.pink)
}
.containerRelativeFrame(.horizontal)
.background(Color.orange)
.listRowSeparator(.hidden)
}
.scrollIndicators(.hidden)
.listStyle(.inset)
New contributor
Karan Mehta is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
2