I am coding a kind of chat GUI, so when a entry event is excuted it shoud get the text inside it and set it into a label which then is set into a frame, so that that frame can be stablished in a stacklayout which is previously defined in the .xaml file. The problem is the text is gotten but the frame with the given text never appears on screen
i tried this
private void Entry_Completed(object sender, EventArgs e){
string text = Entrada.Text;
var rectangle = new Frame
{
Content = new Label
{
Text = text,
FontAttributes = FontAttributes.Bold,
VerticalTextAlignment = TextAlignment.Center,
HorizontalTextAlignment = TextAlignment.Center,
FontAutoScalingEnabled = true,
TextColor = Color.FromArgb("ffffff"),
},
MaximumHeightRequest = layout2.WidthRequest / 2,
HorizontalOptions = LayoutOptions.End,
BackgroundColor = Color.FromArgb("#1D438A"),
};
Entry.Text = "";
layout2.Children.Add(rectangulo);
}
New contributor
diego alvarez is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.