I avent used flexbox stuff before, but i have used CSS in the past. Im trying to understand why my boxes are overlapping in the corners, Ive tried seperating the parent/children out in multiple ways, but I get the same result. Maybe its the position_type, but removing that just shoves everything right next to each other, eve if one node is suppose to go 100% of the way across the width of the screen. Can anyone give me an idea of what Im doing wrong here?
in this example, I want the yellow rectangle below the red one, and the purple and green to be stacked within the yellow one.
display: Display::Flex,
width: Val::Percent(100.0),
height: Val::Percent(100.0),
..default()
})
.with_children(|parent|
{
parent.spawn(Node {position_type: PositionType::Absolute, flex_direction: FlexDirection::Row, width: Val::Percent(100.), height: Val::Percent(7.8), padding: UiRect::bottom(Val::Px(5.)), ..default()});
parent.spawn(Node {position_type: PositionType::Absolute, flex_direction: FlexDirection::Column, width: Val::Percent(19.), height: Val::Percent(80.), ..default()})
.with_children(|parent|
{
parent.spawn(Node {position_type: PositionType::Absolute, flex_direction: FlexDirection::Column, width: Val::Percent(100.), height: Val::Percent(7.8), ..default()});
})
.with_children(|parent|
{
parent.spawn(Node {position_type: PositionType::Absolute, flex_direction: FlexDirection::Column, width: Val::Percent(15.0), height: Val::Percent(10.0), ..default()});
});
}); ```