Skip to content

Content overlaps with ui.add_space(ui.available_width()) #4936

Closed Answered by paulzhang5511
paulzhang5511 asked this question in Q&A
Discussion options

You must be logged in to vote

I got the execution logic of the code wrong.

 fn start_end_ui(ui: &mut Ui) {
        ui.with_layout(Layout::left_to_right(egui::Align::Min), |ui| {
            ui.label("Start Item");
            ui.with_layout(Layout::right_to_left(egui::Align::Min), |ui| {
                ui.label("End Item");
                ui.add_space(ui.available_width());
            });
        });
    }

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by paulzhang5511
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant