Function pin

Source
pub fn pin<'a, Message, Theme, Renderer>(
    content: impl Into<Element<'a, Message, Theme, Renderer>>,
) -> Pin<'a, Message, Theme, Renderer>
where Renderer: Renderer,
Expand description

Creates a new Pin widget with the given content.

A Pin widget positions its contents at some fixed coordinates inside of its boundaries.

ยงExample

use iced::widget::pin;
use iced::Fill;

enum Message {
    // ...
}

fn view(state: &State) -> Element<'_, Message> {
    pin("This text is displayed at coordinates (50, 50)!")
        .x(50)
        .y(50)
        .into()
}