You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+25
Original file line number
Diff line number
Diff line change
@@ -65,6 +65,31 @@ struct ContentView: View {
65
65
66
66
# Customization
67
67
68
+
69
+
### Caption
70
+
71
+
#### Availability: 2.1.0 or higher
72
+
73
+
A caption can be added to the image viewer. The caption will appear near the bottom of the image viewer (if the image fills the whole screen the text will appear on top of the image). The `caption` parameter accepts `Text`.
74
+
75
+
Example:
76
+
```Swift
77
+
importImageViewer
78
+
79
+
structContentView: View {
80
+
@Statevar showImageViewer: Bool=true
81
+
@Statevar image =Image("example-image")
82
+
83
+
var body: some View {
84
+
VStack {
85
+
Text("Example!")
86
+
}
87
+
.frame(maxWidth: .infinity, maxHeight: .infinity)
88
+
.overlay(ImageViewer(image: self.$image, viewerShown: self.$showImageViewer, caption: Text("This is a caption!")))
0 commit comments