Created
July 21, 2020 16:02
-
-
Save sturdysturge/88fd21a83a1f50bc5834c7ce094fe2a3 to your computer and use it in GitHub Desktop.
RevDoc LabelAndTabIndexStyleView
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
import SwiftUI | |
@available(OSX, unavailable) | |
struct TabIndexStyleView: View { | |
@State private var selected = 1 | |
var body: some View { | |
VStack { | |
TabView(selection: self.$selected) { | |
Label("\(selected)", systemImage: "gamecontroller") | |
.labelStyle(DefaultLabelStyle()) | |
.frame(maxWidth: .infinity, maxHeight: .infinity) | |
.background(Color.red) | |
.tag(1) | |
Label("\(selected)", systemImage: "gamecontroller") | |
.labelStyle(IconOnlyLabelStyle()) | |
.frame(maxWidth: .infinity, maxHeight: .infinity) | |
.background(Color.green) | |
.tag(2) | |
Label("\(selected)", systemImage: "gamecontroller") | |
.labelStyle(TitleOnlyLabelStyle()) | |
.frame(maxWidth: .infinity, maxHeight: .infinity) | |
.background(Color.blue) | |
.tag(3) | |
} | |
.indexViewStyle(PageIndexViewStyle(backgroundDisplayMode: .always)) | |
.tabViewStyle(PageTabViewStyle()) | |
} | |
.frame(maxWidth: .infinity, maxHeight: .infinity) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment