nachonavarro / Pages

📖 A lightweight, paging view solution for SwiftUI
MIT License
586 stars 55 forks source link

Rotation issue #14

Closed pavlopedai closed 4 years ago

pavlopedai commented 4 years ago

This is a good lib, but looks like it's not dealing with rotation at all.

nachonavarro commented 4 years ago

Doesn't seem to be broken when I try it. For example, this layout works on both landscape and portrait:

import SwiftUI
import Pages

struct HomeView: View {

    @State var index = 0

    var body: some View {
        Pages(currentPage: $index) {
            VStack {
                Text("First Page")
                Text("First Page -- Part 2")
                HStack {
                    Text("Horizontal 1")
                    Spacer()
                    Text("Horizontal 2")
                }
            }
            Text("Second Page")
            Text("Third Page")
        }
    }
}

struct HomeView_Previews: PreviewProvider {
    static var previews: some View {
        HomeView()
    }
}

Could you add a reproducible example of what you mean?

pavlopedai commented 4 years ago

Ok, then the issue must be my layout itself. Posted an issue without proper research, sorry. Thanks for quick reply!

pavlopedai commented 4 years ago

The issue was not related to page view at all. Frames aren't updating correctly if set via .frame(width: proxy.size.width, height: proxy.size.heigh) Sorry for disturbing.