flutter - ExpansionTile or ExpansionPanel with horizontal scrolling using flutter
问题描述
I'm trying to implement expansionTile with horizontal scrolling Listview not vertical . So in this below image I want make this enter image description here.
解决方案
Answer is to use scrollDirection: Axis.horizontal,
in your ListView
UPDATE
Column(
children: <Widget>[
Flexible(
child: ListView(
children: [
Container(
width: 100,
child: ListTile(
title: Text('No1'),
onTap: () {
setState(() {
selected = 0;
});
},
),
),
Container(
width: 100,
child: ListTile(
title: Text('No2'),
onTap: () {
setState(() {
selected = 1;
});
},
),
)
],
scrollDirection: Axis.horizontal,
),
),
Container(
height: 150,
color: selected == 0 ? Colors.red : Colors.green,
)
],
);
推荐阅读
- c - 我试图通过逐行循环像素来模糊位图,但程序崩溃
- apache - htaccess 从旧网址重定向到新网址
- azure - Web App 后台任务的暂存槽处理消息
- c# - 从调用中获取函数的精确定义,该调用在接口中定义,但使用 Roslyn 在 C# 中的多个位置实现
- javascript - 如何满足依赖不同版本 React 的库?新PM
- reactjs - 是否可以在 .js 文件而不是 .ts 文件中使用 React Antd 图表?(尝试导入错误:“__spreadArray”未从“tslib”导出。)
- flutter - 在 boolean_selector-2.1.0 中找不到名为“pubspec.yaml”的文件
- css - 如何始终让您的标题出现在第一页,但将其隐藏在 CSS 打印文件的后续页面中?
- dropbox-api - 如何获取共享链接以进行编辑
- migration - 邮箱迁移 GSuite 到 Office - 错误:MigrationPermanentException:对 https://www.googleapis.com/oauth2/v4/token 的调用返回状态码