我是Flutter的新手。如何在行中应用水平滚动 View 。如果可以的话请给我一个解决方案,然后我接受您的回答这里有人为此提供解决方案吗?提前致谢。这是我的代码。
Row(
// crossAxisAlignment: CrossAxisAlignment.start,
children: categoryData.map((i) {
print('i====>>>>>>>>>>>>>>>>>.${i['name']}');
scrollDirection:
Axis.horizontal;
return FlatButton(
color: Colors.blue,
textColor: Colors.white,
disabledColor: Colors.grey,
disabledTextColor: Colors.black,
padding: EdgeInsets.all(8.0),
splashColor: Colors.blueAccent,
onPressed: () {
/*...*/
},
child: Text(
'${i['name']}',
style: TextStyle(fontSize: 12.0),
),
);
}).toList(),
),
最佳答案
Row中没有参数scrollDirection
。将scrollview放在ROW的顶部。喜欢
SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Row(.....),
)
关于flutter - 引发了另一个异常:RenderFlex在Flutter的右侧溢出了265个像素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58689337/