Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

底部Tab切换时候趋势的tab会重绘绘制 #271

Closed
superSp opened this issue Feb 13, 2019 · 4 comments
Closed

底部Tab切换时候趋势的tab会重绘绘制 #271

superSp opened this issue Feb 13, 2019 · 4 comments

Comments

@superSp
Copy link

superSp commented Feb 13, 2019

首页进去底部三个tab ,选中趋势,往下滑一些,之后在点击tab3 和tab1 最后回到tab2,会发现又会滚动到顶部,应该是重绘了,最近一直在找keep方法。。多tab切换和跳转返回时的保持。。

@CarGuo
Copy link
Owner

CarGuo commented Feb 13, 2019

是keep住的,应该是出发了新的网络请求导致数据更新了,你可以试试在请求到数据后设置下不再请求看看

@superSp
Copy link
Author

superSp commented Feb 13, 2019

是keep住的,应该是出发了新的网络请求导致数据更新了,你可以试试在请求到数据后设置下不再请求看看

嗯 好的 谢谢啦,用了你的GSYTab控件 但是我跳转的时候回来以后 再点击其他tab就会导致重绘,还有就是3个tab的keep的问题。。我下载了你的代码 ,在好好研究下 , 谢谢谢

@superSp superSp closed this as completed Feb 13, 2019
@CarGuo
Copy link
Owner

CarGuo commented Feb 13, 2019

可以看看这个项目的 GSYTabBarWidget 代码。
主页和仓库详情页都有tab,但是仓库详情页没有这个问题,因为仓库详情页是用 TabBar 和 PageView,而主页是用TabBarView 和 TabBar。你可以对比下看看

@312223105
Copy link

Tab中的page加上with AutomaticKeepAliveClientMixin,并实现

@protected
  bool get wantKeepAlive=>true;

即可避免重绘

@CarGuo CarGuo mentioned this issue Nov 21, 2019
@w497763094 w497763094 mentioned this issue Mar 10, 2020
@JevonShi JevonShi mentioned this issue Mar 10, 2020
@HaobinXu HaobinXu mentioned this issue Mar 20, 2020
@luan823230 luan823230 mentioned this issue Mar 24, 2020
@hzg1105 hzg1105 mentioned this issue Jun 14, 2020
@wangkr wangkr mentioned this issue Jul 4, 2020
@jayVRIY jayVRIY mentioned this issue Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants