소스 검색

fix x axis labels in live activity charts when near midnight

polscm32 2 년 전
부모
커밋
5d9521d32c
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      LiveActivity/LiveActivity.swift

+ 2 - 1
LiveActivity/LiveActivity.swift

@@ -138,7 +138,8 @@ struct LiveActivity: Widget {
             }
             .chartXAxis {
                 AxisMarks(position: .automatic) { _ in
-                    AxisValueLabel().foregroundStyle(Color.white)
+                    AxisValueLabel(format: .dateTime.hour(.defaultDigits(amPM: .narrow)), anchor: .top)
+                        .foregroundStyle(Color.white)
                     AxisGridLine(stroke: .init(lineWidth: 0.1, dash: [2, 3])).foregroundStyle(Color.white)
                 }
             }