我正在尝试水平对齐图标并使其排成一行,使用
我得到的结果类似于这样:
但我想要的结果是这样的:
我的代码:
mainAxisAlignment: MainAxisAlignment.spaceEvenly
和 crossAxisAlignment: CrossAxisAlignment.center
。我得到的结果类似于这样:
![result I am getting](https://istack.dev59.com/eU79J.webp)
![desired result](https://istack.dev59.com/S1xxt.webp)
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
IconButton(onPressed: ()=>{}, icon: Icon(Icons.home_sharp, color: Color(0xFFf1a40a), size: 40,)),
IconButton(onPressed: ()=>{}, icon: Icon(Icons.search_sharp, color: Color(0xFFe7e5d3), size: 40,)),
IconButton(onPressed: ()=>{}, icon: Icon(Icons.add_circle_outlined, color: Color(0xFFfad974), size: 60,)),
IconButton(onPressed: ()=>{}, icon: Icon(Icons.notifications, color: Color(0xFFe7e5d3), size: 40,)),
IconButton(onPressed: ()=>{}, icon: Icon(Icons.people_alt_sharp, color: Color(0xFFe7e5d3), size: 40,)),
],
)
有人可以帮忙吗?
mainAxisAlignment: MainAxisAlignment.spaceAround,
如果在你的情况下需要。 - Yeasin Sheikh