tabview

TabView with “PageTabViewStyle” does not update it's content when @State var changes

纵然是瞬间 提交于 2020-11-29 09:02:52
问题 I came across a weird Issue in SwiftUI. I created a simple View that only holds a Button and a TabView that uses the PageViewStyle. It seems that the TabView does not update it's content correctly depending on the State of the Variable. It seems that the content gets updated somehow but the View wont be updated how I would expect Here is the Code of my View: struct ContentView: View { @State var numberOfPages: Int = 0 @State var selectedIndex = 0 var body: some View { VStack { Text("Tap Me")

Flutter tabview refresh issue

与世无争的帅哥 提交于 2020-07-05 11:26:52
问题 I have a TabBarView in my main.dart and every tab got a class to show the content(it's listview object), when i go between the tabs, the listview page refresh everytime, is it normal for tabbarview? I don't expect it will refresh everytime when i go between the tabs. is it the problem my class? how to fix this? the code is something like this. class ListWidget extends StatefulWidget { final catID; ListWidget(this.catID); _ListWidgetState createState() => new _ListWidgetState(catID); } class

Flutter tabview refresh issue

核能气质少年 提交于 2020-07-05 11:26:48
问题 I have a TabBarView in my main.dart and every tab got a class to show the content(it's listview object), when i go between the tabs, the listview page refresh everytime, is it normal for tabbarview? I don't expect it will refresh everytime when i go between the tabs. is it the problem my class? how to fix this? the code is something like this. class ListWidget extends StatefulWidget { final catID; ListWidget(this.catID); _ListWidgetState createState() => new _ListWidgetState(catID); } class