颤动 – InkWell没有出现涟漪效应
点击容器会触发onTap处理程序,但不会显示任何墨水飞溅效果.
class _MyHomePageState extends State<MyHomePage> { @override Widget build(BuildContext context) { return new Scaffold( appBar: new AppBar( title: new Text(widget.title),),body: new Center( child: new InkWell( onTap: (){print("tapped");},child: new Container( width: 100.0,height: 100.0,color: Colors.orange,); } } 我尝试将InkWell放入容器内,但是徒劳无功. 解决方法
我认为在容器中添加颜色可以覆盖墨水效果
https://docs.flutter.io/flutter/material/InkWell/InkWell.html 这段代码似乎有效 body: new Center( child: new Container( child: new Material( child: new InkWell( onTap: (){print("tapped");},child: new Container( width: 100.0,color: Colors.transparent, 只需点击中间的方块. 编辑:我找到了bug报告. https://github.com/flutter/flutter/issues/3782
–hixie (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |