Skip to content

Confusion in display items using rows and columns #1243

Answered by genusistimelord
tareksalem asked this question in Q&A
Discussion options

You must be logged in to vote

Well you are adding one card to a Row so you need to make a builder to add 2 then make a new row after 2. So something like this:

pub fn render_mark_components<'a>() -> Container<'a, Message> {
    let mut row = Row::new().width(Length::Fill).spacing(20).align_items(Align::Center);
	let mut container = Column::new().width(Length::Fill).align_items(Align::End);
	let mut count = 0;

	for mark_data in MarkData::all().iter_mut() {
		if count >= 2 {
			container = container.push(row);
			row = Row::new().width(Length::Fill).spacing(20).align_items(Align::Center);
			count = 0;
		} else {
			count += 1;
		}
			
		row = row.push(Column::new().spacing(15).width(Length::Fill).height(Length::Units(50)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by tareksalem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants