问题描述
我正在使用 LazyVGrid 显示日历月,并希望 Sat 和 Sun 列具有不同的背景颜色。
LazyVGrid(columns: columns,spacing: 34) {
ForEach(daysForMonthView,id: \.self) { day in
Text(dayFormatter.string(from: day.start))
.fontWeight(.semibold)
.foregroundColor(
currentdisplayMonth.contains(day) ? .primary : .secondary
)
.background (
ZStack {
if let selectedDay = selectedDay,selectedDay == day {
RoundedRectangle(cornerRadius: 4)
.fill(Color(white: 0.3))
.frame(width: 30,height: 30)
}
if day.contains(Date()) {
RoundedRectangle(cornerRadius: 4)
.stroke(Color.secondary,linewidth: 1)
.frame(width: 30,height: 30)
}
practiceSymbolRow(forDay: day)
.offset(y: 20)
}
)
.onTapGesture {
selectedDay = day
}
}
}
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)