Skip to main content

hstack

Function hstack 

Source
pub fn hstack(children: &[View]) -> View
Examples found in repository?
examples/app.rs (lines 18-21)
9fn main() {
10    run(|| {
11        vstack(&[
12            text("Hello from Rust! ๐Ÿฆ€")
13                .padding(12.0)
14                .bg(Color::BLUE)
15                .rounded(8.0)
16                .opacity(0.95),
17            spacer(),
18            hstack(&[
19                image("star.fill"),
20                text("No Swift compiler needed"),
21            ]),
22            divider(),
23            text("Pure dlsym + arm64 asm โ†’ SwiftUI")
24                .padding(8.0),
25        ])
26        .padding(40.0)
27        .into_handle()
28    });
29}
More examples
Hide additional examples
examples/scenes.rs (lines 57-60)
48fn main_window() -> ViewHandle {
49    vstack(&[
50        text("A SwiftUI app, no Swift source")
51            .font_size(20.0)
52            .padding(8.0),
53        divider(),
54        text(&format!("count: {}", counter().get()))
55            .font_size(34.0)
56            .padding(12.0),
57        hstack(&[
58            button("โˆ’", || counter().set(counter().get() - 1)),
59            button("+", || counter().set(counter().get() + 1)),
60        ]),
61        spacer(),
62        text("โŒ˜, for Settings ยท the โ˜… in the menu bar has a menu")
63            .font_size(11.0)
64            .opacity(0.6),
65    ])
66    .padding(24.0)
67    .frame(420.0, 300.0)
68    .focused_scene_value(counter_focus_key(), counter().get())
69    .into_handle()
70}