Closed DizzyDuan closed 2 years ago
???
白色背景看不出来 换成黑色背景 缓慢滑动 每一个page之间都会有一条白线
当tabview拉扯到另一个tabview明显
在ios上尤为明显
官方会吗?
官方不会
单独使用ExtendedTabBarView也不会 只有ExtendedTabBarView嵌套ExtendedTabBarView会出现
例如0Tab有两个page其中0-page下是1Tab 1Tab下有两个page
当1Tab滑动到0Tab的时候会缓慢滑动会有白线闪烁 划过去以后会有阴影
IOS上阴影很明显
希望作者可以提供解决方案
感谢
你不使用 GlowingOverscrollIndicator 就好了,你可以自己写一个自定义的效果
我其实并没有使用 GlowingOverscrollIndicator
我只是怀疑可能是这个造成的
具体是因为什么还不清楚
我没有更改库只是使用
你可以自己定义哦,比如定义成安卓的phy
我有使用ScrollConfigurationr调整GlowingOverscrollIndicator的showLeading和showTrailing为false
但是依然会有阴影和白线
我看了下。这个是官方的bug, 你可以在listview里面每个item 加颜色,滚动的时候也有这种东西,解决方案就是给整个大背景加一样的颜色,或者给你的item 加缩放,比如缩放1.01 这是像素的问题
设置大背景色我有试过。没有解决。缩放还没有试。
可惜。缩放依然没有解决问题。
单独使用TabBarView也是没有问题。
只有在子Tab滑动到父Tab的时候会很明显。
return Container(
color: Colors.blue,
transform: Matrix4.diagonal3Values(1.1, 1.0, 1.0),
child: ListView.builder(
itemBuilder: (BuildContext c, int i) {
return Container(
//decoration: BoxDecoration(border: Border.all(color: Colors.orange,width: 1.0)),
alignment: Alignment.center,
height: 60.0,
child: Text('$tabKey : List$i'));
},
itemCount: 100,
scrollDirection: scrollDirection,
),
);
不能重现
我按照你提供的方式在ExtendedTabBarView使用没有生效。依然会有这个问题。
我现在很郁闷的是单独TabbarView子page切换没有问题
只有在子Tab滑动到父Tab会有问题。
我的实现和抖音一样
子Tab包含关注和推荐。父Tab包含子Tab和用户详情(也有子Tab)
子Tab内部切换没有问题
当子Tab滑动到父Tab用户详情就会很明显
请提供一个最简单的,能复现问题,可以运行的demo
import 'package:extended_tabs/extended_tabs.dart';
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
final String title;
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> with TickerProviderStateMixin {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: ExtendedTabBarView(
controller: TabController(
length: 2,
vsync: this,
),
children: [
ExtendedTabBarView(
controller: TabController(
length: 2,
vsync: this,
),
children: [
Container(
alignment: Alignment.center,
color: Colors.black54,
child: Text(
"关注",
style: TextStyle(
color: Colors.white,
fontSize: 50,
),
),
),
Container(
alignment: Alignment.center,
color: Colors.black,
child: Text(
"推荐",
style: TextStyle(
color: Colors.white,
fontSize: 50,
),
),
),
],
),
Column(
children: [
Container(
alignment: Alignment.center,
width: double.infinity,
height: 200,
color: Colors.black,
child: Text(
"用户详情",
style: TextStyle(
color: Colors.white,
fontSize: 25,
),
),
),
Expanded(
child: ExtendedTabBarView(
controller: TabController(
length: 2,
vsync: this,
),
children: [
Container(
alignment: Alignment.center,
color: Colors.black45,
child: Text(
"作品",
style: TextStyle(
color: Colors.white,
fontSize: 25,
),
),
),
Container(
alignment: Alignment.center,
color: Colors.black54,
child: Text(
"喜欢",
style: TextStyle(
color: Colors.white,
fontSize: 25,
),
),
),
],
),
),
],
),
],
),
);
}
}
你好 作者
之前代码不清晰。我已重新调整。
只需从推荐缓慢滑动到用户详情即可发现问题。
还有其他补充吗。请更新到最新代码试试
不更改link.dart
只修改ListWidget
添加一个背景色
切换Tab存在白线。应该是GlowingOverscrollIndicator的阴影。
感谢作者提供很好的库