Skip to content
This repository was archived by the owner on Dec 27, 2020. It is now read-only.

Commit 47260f1

Browse files
authored
spacing and focus (#24)
1 parent bd9a76f commit 47260f1

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

Examples/GridExamples/AutoColumnsLayoutView.swift

+12
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,24 @@ struct AutoColumnsLayoutView: View {
66

77
var body: some View {
88
Grid(0..<100) { number in
9+
#if os(tvOS)
10+
Card(title: "\(number)")
11+
.focusable(true) { focus in
12+
if focus {
13+
self.selection = number
14+
}
15+
}
16+
#else
917
Card(title: "\(number)")
1018
.onTapGesture {
1119
self.selection = number
1220
}
21+
#endif
22+
1323
}
1424
.padding()
25+
.gridStyle(AutoColumnsGridStyle(minItemWidth: 240, itemHeight: 120))
26+
1527
.overlayPreferenceValue(GridItemPreferences.Key.self) { preferences in
1628
GeometryReader { geometry in
1729
RoundedRectangle(cornerRadius: 16)

Examples/GridExamples/FixedColumnsLayoutView.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ struct FixedColumnsLayoutView: View {
88
}
99
.padding()
1010
.gridStyle(
11-
FixedColumnsGridStyle(columns: 3, itemHeight: 80)
11+
FixedColumnsGridStyle(columns: 3, itemHeight: 120)
1212
)
1313
}
1414
}

Examples/GridExamples/SingleColumnLayoutView.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ struct SingleColumnLayoutView: View {
88
}
99
.padding()
1010
.gridStyle(
11-
SingleColumnGridStyle(itemHeight: 80)
11+
SingleColumnGridStyle(itemHeight: 120)
1212
)
1313
}
1414
}

0 commit comments

Comments
 (0)