Skip to content

Instantly share code, notes, and snippets.

@TuenTuenna
Last active September 3, 2021 07:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TuenTuenna/601157c21088fc3322cb45a7f0d850c6 to your computer and use it in GitHub Desktop.
Save TuenTuenna/601157c21088fc3322cb45a7f0d850c6 to your computer and use it in GitHub Desktop.
tabview indicator

SwiftUi Tabview 인디케이터

//
//  ContentView.swift
//  pageview
//
//  Created by Jeff Jeong on 2021/04/18.
//

import SwiftUI

struct ContentView: View {
    var body: some View {
        TabView {
            Color.red
            Color.yellow
            Color.green
            Color.blue
        }
        .tabViewStyle(PageTabViewStyle())
        // .never 로 하면 배경 안보이고 .always 로 하면 인디케이터 배경 보입니다.
        .indexViewStyle(PageIndexViewStyle(backgroundDisplayMode: .never))
       
    }
}

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment