Skip to content

Add new View with Pos.Right() in event handler not working. #2472

Answered by tznind
Corn207 asked this question in Q&A
Discussion options

You must be logged in to vote

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 ();

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@Corn207
Comment options

Answer selected by Corn207
Comment options

You must be logged in to vote
2 replies
@tig
Comment options

tig Mar 31, 2023
Maintainer

@BDisp
Comment options

BDisp Mar 31, 2023
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants