1

I'm creating a TabView in SwiftUI that uses a vertical scrolling mechanism to display images. However, the images are cropped on the sides with the code I'm using, and I'm looking for an uncropped look. Interestingly, they only become cropped when running on an iPad in landscape mode. Would anyone be able to help? Thanks!

TabView {
   ForEach(courses, id: \.self) { course in
       NavigationLink {
           iPadInfoView(event: course)
       } label: {
           ZStack {
             Image("event_img")
                .resizable()
                .padding([.leading, .trailing])
                .scaledToFit()
             VStack {
                Text(course.title)
                    .foregroundColor(.white)
                    .fontWeight(.heavy)
                    .font(.system(size: 28))
                Text(course.location ?? "No Location")
                    .foregroundColor(.white)
                    .padding([.top])
                Text(course.startDate, style: .time)
                    .foregroundColor(.white)
                    .italic()
         }
       }
     }
    .rotationEffect(.degrees(270))
  }
}
.tabViewStyle(.page(indexDisplayMode: .never))
    .rotationEffect(.degrees(90))
    .navigationTitle("Today")

0 Answers0