# 在开始和居中的行中排列元素

I have a dilemma that I can't seem to solve. I have an existing row in Flutter. Essentially what I want to accomplish is to have the first element(yellow) at the start of the row, and the second element(red) in the center of the element. I know Row has the `mainAxisAlignment`, but I need a different alignment for each each element (i.e. both `MainAxisAlignment.start` & `MainAxisAlignment.center`). Thanks for any help!

``````Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
yellowElement,
Expanded(child: redElement),
],
);
``````

• 咕噜咕噜 回复

几周前我遇到了这个问题，我发现的唯一解决方案是Stack ...像这样

``````        Stack(
children: <Widget>[
Container(
color: Colors.grey,
width: 250,
height: 50,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
Container(width: 50, color: Colors.red),
],
),
),
Positioned(
top: 0,
bottom: 0,
child: Container(
width: 20,
color: Colors.yellow,
),
)
],
)
``````