How can I implement PageView in SwiftUI?

后端 未结 4 539
被撕碎了的回忆
被撕碎了的回忆 2020-11-29 09:52

I am new to SwiftUI. I have three views and I want them in a PageView. I want to move each Views by swipe like a pageview and I want the little dots to indicate in which vie

4条回答
  •  一整个雨季
    2020-11-29 10:05

    The easiest way to do this is via iPages.

    import SwiftUI
    import iPages
    
    struct ContentView: View {
        @State var currentPage = 0
        var body: some View {
            iPages(currentPage: $currentPage) {
                Text("

提交回复
热议问题