Skip to main content

system_image

Function system_image 

Source
pub fn system_image(name: &str) -> ViewHandle
Expand description

Create an Image from an SF Symbol name.

Examples found in repository?
examples/ios_app.rs (line 260)
257fn symbols() -> views::ViewHandle {
258    let icon = |name: &str, c: Color| {
259        views::foreground_style_color(
260            &views::font_system(&views::system_image(name), 24.0, None, None),
261            c.r, c.g, c.b, c.a,
262        )
263    };
264    views::hstack_spacing(
265        &[
266            icon("star.fill", Color::new(1.0, 0.8, 0.2, 1.0)),
267            icon("heart.fill", Color::new(1.0, 0.35, 0.45, 1.0)),
268            icon("bolt.fill", Color::new(0.55, 0.8, 1.0, 1.0)),
269            icon("cloud.sun.fill", Color::new(0.8, 0.85, 1.0, 1.0)),
270            icon("checkmark.seal.fill", Color::new(0.4, 0.9, 0.6, 1.0)),
271        ],
272        16.0,
273    )
274}