Hi Liu. I want to update you that I built a new app that contains the relevant issue and is working ok. now I will to eliminate and try until I found the segment in my app that prevent this to run ok. sorry about the upset I caused to you. Thank you.
Maui android label text property problem issue
Haviv Elbsz
2,071
Reputation points
Hello all.
Maui Ver 17.9 preview 2 Android Ver 34.
In my app I have a label with the property Text problem (label.txt = string)
as shown in the following code:
private void ShowText()
{
if(String.IsNullOrEmpty(pattern))
{
OutputText.Text += "\nNeed Input\n"; // This work OK
return;
}
try
{
re = new Regex(pattern, options);
}
catch (ArgumentException ex)
{
OutputTex.Text += "RROR " + "\n" + "\n" + ex.ToString();// This NOT work
return;
}
}
// Note that in some place in the app I use this code
XformattedString.Spans.Add(new Span { Text = yString });
OutputText.FormattedText = XformattedString;
// Please any help for resolve this problem as shown
// commented ( //... ) in the //above code.
// Thank you.
I found this see link and picture.
What the remarks mean and how I can set a string to Text property.
https://learn.microsoft.com/en-us/dotnet/api/microsoft.maui.controls.label.text?view=net-maui-8.0