You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm trying to learn to use Grid and GridRow for text-alignment purposes.
When I use this code, it does what I expect:
fn view(&self) -> Element<Self::Message> {
let row = GridRow::with_elements(vec![
Text::new("x"),
Text::new("x"),
Text::new("x"),
Text::new("x"),
Text::new("longer string of text"),
]);
let grid = Grid::with_rows(vec![row]).column_width(Length::Fixed(5.0));
grid.into()
}
The cells are all together with no space between them. But if I move the cell with wider text from the last to the first like this:
let row = GridRow::with_elements(vec![
Text::new("longer string of text"),
Text::new("x"),
Text::new("x"),
Text::new("x"),
Text::new("x"),
]);
now I get this:
Now instead of the cells being together, they are spaced out. Why? Yes I have read the documentation but no I still don't understand the logic. In both cases I have set the width of all columns to a fixed value of 5. What if I want both the wider cell to be on the left and also for the cells to have no space between them? How can I accomplish that?
(Also this is just a single-row example, my use case has multiple rows so the standard iced Row apparently will not meet my need for a grid.)
Thanks!
The text was updated successfully, but these errors were encountered:
if the first is the bigger width, the rest will be set to that width. I really am not sure how Grid Really should be done, or what the original author's purpose of Grid was for.
Hi, I'm trying to learn to use
Grid
andGridRow
for text-alignment purposes.When I use this code, it does what I expect:
The cells are all together with no space between them. But if I move the cell with wider text from the last to the first like this:
now I get this:
Now instead of the cells being together, they are spaced out. Why? Yes I have read the documentation but no I still don't understand the logic. In both cases I have set the width of all columns to a fixed value of 5. What if I want both the wider cell to be on the left and also for the cells to have no space between them? How can I accomplish that?
(Also this is just a single-row example, my use case has multiple rows so the standard iced
Row
apparently will not meet my need for a grid.)Thanks!
The text was updated successfully, but these errors were encountered: