Giter Site home page Giter Site logo

jasudev / axissegmentedview Goto Github PK

View Code? Open in Web Editor NEW
171.0 3.0 14.0 1.21 MB

A library that allows you to easily create various styles of segmented views. Supports iOS, macOS and tvOS.

License: MIT License

Swift 100.00%
swiftui swift segmented-controls segmented segmentedcontrol segment segmentedview segmented-view ios macos

axissegmentedview's People

Contributors

jasudev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

axissegmentedview's Issues

Selected tab indicator not working for ASLineStyle on ios 14.x

When using the segmented view with style of ASLineStyle, the blue bottom selected line indicator does not move to the selected segment when tapping on any of the segments. This issue only happens on ios 14.x. Note that selection is actually happening and there is the haptic feedback and even the onTapReceive event is triggered properly. It's just the blue line always stays on the first segment and does not move at all.

  @State private var selection: Int = 0
    var body: some View {
        VStack {
            AxisSegmentedView(selection: $selection, constant: ASConstant(divideLine: .init(color: Color.blue, scale: 0))) {

                Image(systemName: "iphone")
                    .itemTag(0) {
                        Image(systemName: "iphone")
                    }
                Image(systemName: "ipad.landscape")
                    .itemTag(1) {
                        Image(systemName: "ipad.landscape")
                    }
                Image(systemName: "laptopcomputer")
                    .itemTag(2) {
                        Image(systemName: "laptopcomputer")
                    }
                Image(systemName: "applewatch")
                    .itemTag(3) {
                        Image(systemName: "applewatch")
                    }

            } style: {
                ASLineStyle(lineColor: .blue,
                            lineSmallWidth: 2,
                            lineLargeScale: 1,
                            lineEdge: .bottomTrailing,
                            movementMode: .normal)

            }
        onTapReceive: { selectionTap in
        }
        .font(.system(size: 20))
        .frame(width: 320, height: 44)
    }
}

auto item width?

Is item adaptive sizing supported? Not equal item size, thank you!

Using as Tab

first of all, amazing work. The only question is can we use this segment view as tab view? is it possible?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.