We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 07b96f2 commit b003a24Copy full SHA for b003a24
Sources/LiveViewNative/Views/Layout Containers/Scroll Views/ScrollView.swift
@@ -16,8 +16,28 @@ struct ScrollView<R: CustomRegistry>: View {
16
}
17
18
public var body: some View {
19
- SwiftUI.ScrollView {
+ SwiftUI.ScrollView(axes, showsIndicators: showsIndicators) {
20
context.buildChildren(of: element)
21
22
23
+
24
+ private var axes: Axis.Set {
25
+ switch element.attributeValue(for: "axes") {
26
+ case "all":
27
+ return [.horizontal, .vertical]
28
+ case "horizontal":
29
+ return .horizontal
30
+ default:
31
+ return .vertical
32
+ }
33
34
35
+ private var showsIndicators: Bool {
36
+ if let attr = element.attributeValue(for: "shows-indicators") {
37
+ return attr == "true"
38
+ } else {
39
+ return true
40
41
42
43
0 commit comments