How to make carousel lists on watchOS
About 2 min
How to make carousel lists on watchOS 관련
SwiftUI by Example
Back to Home
How to make carousel lists on watchOS | SwiftUI by Example
How to make carousel lists on watchOS
Updated for Xcode 15
watchOS has a particularly common list style that can easily be replicated using List
: rows in the list slide and scale up when they are moving onto the screen, then slide and and scale down when they are moving off the screen. This is particularly effective with chunkier, graphical rows – it’s almost like Apple’s old Cover Flow effect.
To enable this carousel effect, use the .listStyle()
modifier with .carousel
, like this:
List(1..<51) {
Text("\($0)")
}
.listStyle(.carousel)
<
Important
If you’re using Xcode 12 you need to use CarouselListStyle()
rather than .carousel
.
Note
this is available only on watchOS.
Similar solutions…
How to read the Digital Crown on watchOS using digitalCrownRotation() | SwiftUI by Example
How to read the Digital Crown on watchOS using digitalCrownRotation()
How to create multi-column lists using Table | SwiftUI by Example
How to create multi-column lists using Table
Working with lists | SwiftUI by Example
Working with lists
How to get translucent lists on macOS | SwiftUI by Example
How to get translucent lists on macOS
How to create grouped and inset grouped lists | SwiftUI by Example
How to create grouped and inset grouped lists