Why the Text
for Date
takes so much space.
var body: some View {
VStack{
HStack(alignment: .top, spacing: 0) {
VStack{
Text(entry.date, style:.relative)
}
.background(Color.yellow)
Text("ago")
}
.font(.system(size: 12))
.foregroundColor(.gray)
}.padding()
}
I would like to display the ago
static text right after the dynamic date Text
element in HStack
I can simply do this:
Text("\(entry.date, style: .relative) ago")
and there is no need for a HStack
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.