Use column! and row! to group multiple widgets such as text and button.
use iced::{
widget::{button, column, row, text},
Sandbox, Settings,
};
fn main() -> iced::Result {
MyApp::run(Settings::default())
}
struct MyApp;
impl Sandbox for MyApp {
type Message = ();
fn new() -> Self {
Self
}
fn title(&self) -> String {
String::from("My App")
}
fn update(&mut self, _message: Self::Message) {}
fn view(&self) -> iced::Element<Self::Message> {
column![
text("Yes or no?"),
row![
button("Yes"),
button("No"),
],
].into()
}
}
➡️ Next: Changing Displaying Content
📘 Back: Table of contents