This commit is contained in:
JinJiangHuang
2026-03-02 12:53:16 +08:00
parent e58322339f
commit dc1a010e05
+7 -9
View File
@@ -13,6 +13,8 @@ struct EpisodeListView: View {
@State private var currentGroup = 0 @State private var currentGroup = 0
/// ///
private let groupSize = 50 private let groupSize = 50
///
private let gridColumns = [GridItem(.adaptive(minimum: 78), spacing: 10)]
/// 1 0 /// 1 0
private var groupCount: Int { private var groupCount: Int {
@@ -63,12 +65,8 @@ struct EpisodeListView: View {
} }
} }
// //
ScrollView(.horizontal, showsIndicators: false) { LazyVGrid(columns: gridColumns, alignment: .leading, spacing: 10) {
LazyHGrid(rows: [
GridItem(.fixed(44)),
GridItem(.fixed(44))
], spacing: 10) {
// 使 + 便 // 使 + 便
ForEach(Array(currentEpisodes.enumerated()), id: \.offset) { index, episode in ForEach(Array(currentEpisodes.enumerated()), id: \.offset) { index, episode in
let actualIndex = currentGroup * groupSize + index let actualIndex = currentGroup * groupSize + index
@@ -78,7 +76,9 @@ struct EpisodeListView: View {
Text(episode.name) Text(episode.name)
.font(.system(size: 13, weight: actualIndex == selectedIndex ? .bold : .medium)) .font(.system(size: 13, weight: actualIndex == selectedIndex ? .bold : .medium))
.foregroundColor(actualIndex == selectedIndex ? .white : .white.opacity(0.7)) .foregroundColor(actualIndex == selectedIndex ? .white : .white.opacity(0.7))
.frame(minWidth: 70) .lineLimit(1)
.minimumScaleFactor(0.85)
.frame(maxWidth: .infinity)
.frame(height: 44) .frame(height: 44)
.background( .background(
ZStack { ZStack {
@@ -100,7 +100,5 @@ struct EpisodeListView: View {
} }
.padding(.horizontal, 20) .padding(.horizontal, 20)
} }
.frame(height: 100)
}
} }
} }