-
|
Beta Was this translation helpful? Give feedback.
Answered by
tznind
Mar 30, 2023
Replies: 2 comments 3 replies
-
Add a call to var newBtn = new Button () {
X = Pos.Right (uselessBtn) + 1,
Y = 0,
Text = "New"
};
Add (newBtn);
+LayoutSubviews (); |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Corn207
-
@tznind this can be avoided if the @tig something went wrong in your last merge. public override void Init ()
{
Application.Init ();
Application.Run (new MainWindow ());
}
internal class MainWindow : Window {
public MainWindow ()
{
var addBtn = new Button () {
X = 0,
Y = 0,
Text = "Add"
};
var uselessBtn = new Button () {
X = Pos.Right (addBtn),
Y = 0,
Text = "Useless"
};
addBtn.Clicked += (s, e) => {
var newBtn = new Button () {
X = Pos.Right (uselessBtn) + 1,
Y = 0,
Text = "New"
};
Add (newBtn);
LayoutSubviews ();
};
Add (addBtn, uselessBtn);
}
} |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add a call to
LayoutSubviews ();
after adding the button:var newBtn = new Button () { X = Pos.Right (uselessBtn) + 1, Y = 0, Text = "New" }; Add (newBtn); +LayoutSubviews ();