This repository has been archived by the owner on May 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[macOS] Fix crash setting the default Label color using Span (#11300) f…
- Loading branch information
1 parent
c68071a
commit 7160b30
Showing
3 changed files
with
80 additions
and
1 deletion.
There are no files selected for viewing
78 changes: 78 additions & 0 deletions
78
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue11272.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
using Xamarin.Forms.Internals; | ||
using Xamarin.Forms.CustomAttributes; | ||
|
||
#if UITEST | ||
using Xamarin.UITest; | ||
using NUnit.Framework; | ||
using Xamarin.Forms.Core.UITests; | ||
#endif | ||
|
||
namespace Xamarin.Forms.Controls.Issues | ||
{ | ||
#if UITEST | ||
[Category(UITestCategories.Label)] | ||
#endif | ||
[Preserve(AllMembers = true)] | ||
[Issue(IssueTracker.Github, 11272, | ||
"[Bug] Crash XF for Mac 4.7.0.1080", | ||
PlatformAffected.macOS)] | ||
public class Issue11272 : TestContentPage | ||
{ | ||
public Issue11272() | ||
{ | ||
|
||
} | ||
|
||
protected override void Init() | ||
{ | ||
Title = "Issue 11272"; | ||
|
||
var layout = new StackLayout(); | ||
|
||
var instructions = new Label | ||
{ | ||
Padding = 12, | ||
BackgroundColor = Color.Black, | ||
TextColor = Color.White, | ||
Text = "Without exception, this test has passed." | ||
}; | ||
|
||
var errorLabel1 = new Label() | ||
{ | ||
HorizontalOptions = LayoutOptions.Center, | ||
FormattedText = new FormattedString | ||
{ | ||
Spans = | ||
{ | ||
new Span() | ||
{ | ||
Text = "🔔🌀 Issue 11272", | ||
} | ||
} | ||
} | ||
}; | ||
|
||
var errorLabel2 = new Label() | ||
{ | ||
HorizontalOptions = LayoutOptions.Center, | ||
FormattedText = new FormattedString | ||
{ | ||
Spans = | ||
{ | ||
new Span() | ||
{ | ||
TextColor = Color.Red, | ||
Text = "🔔🌀 Issue 11272 (Using TextColor)", | ||
} | ||
} | ||
} | ||
}; | ||
|
||
layout.Children.Add(instructions); | ||
layout.Children.Add(errorLabel1); | ||
layout.Children.Add(errorLabel2); | ||
|
||
Content = layout; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters