File tree Expand file tree Collapse file tree 1 file changed +16
-9
lines changed
Shared/Samples/Show realistic light and shadows Expand file tree Collapse file tree 1 file changed +16
-9
lines changed Original file line number Diff line number Diff line change @@ -51,23 +51,30 @@ struct ShowRealisticLightAndShadowsView: View {
5151 }
5252 . frame ( maxWidth: 540 )
5353 . onChange ( of: dateSecond, perform: sliderValueChanged ( toValue: ) )
54- . padding ( )
54+ . padding ( . horizontal)
55+ }
56+ . overlay ( alignment: . top) {
57+ dateTimeOverlay
5558 }
5659 . toolbar {
57- ToolbarItemGroup ( placement: . bottomBar) {
58- Text ( dateTimeText)
59-
60- Menu ( " Mode " ) {
61- Picker ( " Choose a lighting mode for the scene view. " , selection: $lightingMode) {
62- ForEach ( SceneView . SunLighting. allCases, id: \. self) { mode in
63- Text ( mode. label)
64- }
60+ ToolbarItem ( placement: . bottomBar) {
61+ Picker ( " Choose a lighting mode for the scene view. " , selection: $lightingMode) {
62+ ForEach ( SceneView . SunLighting. allCases, id: \. self) { mode in
63+ Text ( mode. label)
6564 }
6665 }
6766 }
6867 }
6968 }
7069
70+ /// An overlay showing the date time adjusted by the slider.
71+ var dateTimeOverlay : some View {
72+ Text ( dateTimeText)
73+ . frame ( maxWidth: . infinity)
74+ . padding ( . vertical, 6 )
75+ . background ( . thinMaterial, ignoresSafeAreaEdges: . horizontal)
76+ }
77+
7178 /// Handles slider value changed event and set the scene view's sun date.
7279 /// - Parameter value: The slider's value.
7380 private func sliderValueChanged( toValue value: Float ) {
You can’t perform that action at this time.
0 commit comments