xmartlabs / PagerTabStripView

🚀 Elegant Pager View fully written in pure SwiftUI.
MIT License
772 stars 88 forks source link

the page slides sideways with an uneven jittering effect when embedding the TwitterView into the TabView #131

Open ibeizhu opened 1 year ago

ibeizhu commented 1 year ago

Describe the bug Referring to the official example, the page slides sideways with an uneven jittering effect when embedding the TwitterView into the TabView

To Reproduce Below code to reproduce the behavior:

import SwiftUI
import PagerTabStripView

struct ContentView: View {
    @State private var selection: Tab = .home
    enum Tab {
        case home
        case my
        case square
    }
    var body: some View {
        TabView(selection: $selection) {
            TwitterView()
                .tabItem {
                    Label("Home", systemImage: "house.fill")
                }
                .tag(Tab.home)
            TwitterView()
                .tabItem {
                    Label("Find", systemImage: "dot.circle.viewfinder")
                }
                .tag(Tab.square)
            TwitterView()
                .tabItem {
                    Label("My", systemImage: "person.crop.circle")
                }
                .tag(Tab.my)
        }
    }
}

Expected behavior Expect smooth horizontal sliding Tabs

Versions (please complete the following information):

ibeizhu commented 1 year ago

the video to show the bug

https://github.com/xmartlabs/PagerTabStripView/assets/15857358/ad4ace86-e39d-47ff-8b6f-64927c9403ad