Created
June 28, 2020 08:29
-
-
Save prafullakumar/77623ad916e65863467e152a6acd3a0f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Created by Prafulla Singh on 23/6/20. | |
// | |
import SwiftUI | |
struct ContentView: View { | |
var body: some View { | |
ScrollView { | |
LazyHStack { | |
PageView() | |
} | |
} | |
} | |
} | |
struct ContentView_Previews: PreviewProvider { | |
static var previews: some View { | |
ContentView() | |
} | |
} | |
struct PageView: View { | |
var body: some View { | |
TabView { | |
ForEach(0..<30) { i in | |
ZStack { | |
Color.black | |
Text("Row: \(i)").foregroundColor(.white) | |
}.clipShape(RoundedRectangle(cornerRadius: 10.0, style: .continuous)) | |
} | |
.padding(.all, 10) | |
} | |
.frame(width: UIScreen.main.bounds.width, height: 200) | |
.tabViewStyle(PageTabViewStyle()) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I need the tabview load the view lazily, is it possible?