Expand description
Containers let you align a widget inside their boundaries.
§Example
use iced::widget::container;
enum Message {
// ...
}
fn view(state: &State) -> Element<'_, Message> {
container("This text is centered inside a rounded box!")
.padding(10)
.center(800)
.style(container::rounded_box)
.into()
}Structs§
- Container
- A widget that aligns its contents inside of its boundaries.
- Style
- The appearance of a container.
Traits§
Functions§
- background
- A
Containerwith the givenBackground. - bordered_
box - A bordered
Containerwith a background. - danger
- A
Containerwith a danger background color. - dark
- A
Containerwith a dark background and white text. - draw_
background - Draws the background of a
Containergiven itsStyleand itsbounds. - layout
- Computes the layout of a
Container. - primary
- A
Containerwith a primary background color. - rounded_
box - A rounded
Containerwith a background. - secondary
- A
Containerwith a secondary background color. - success
- A
Containerwith a success background color. - transparent
- A transparent
Container.