Make NSScrollView for NSTableView not draw background, and add test case. (#6050)

fixes #6021
This commit is contained in:
Oliver Brown 2019-05-11 20:43:01 +01:00 коммит произвёл Samantha Houts
Родитель 5bc4be14ec
Коммит 6c6d43d1cd
3 изменённых файлов: 34 добавлений и 1 удалений

Просмотреть файл

@ -0,0 +1,31 @@
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;
#if UITEST
using Xamarin.Forms.Core.UITests;
using Xamarin.UITest;
using NUnit.Framework;
#endif
namespace Xamarin.Forms.Controls.Issues
{
#if UITEST
[Category(UITestCategories.ManualReview)]
#endif
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Github, 6021, "[macOS] ListView does not handle transparent backgrounds correctly", PlatformAffected.macOS)]
public class Github6201 : TestContentPage // or TestMasterDetailPage, etc ...
{
protected override void Init()
{
BackgroundColor = Color.Red;
Content = new ListView
{
Margin = new Thickness(20),
BackgroundColor = Color.FromRgba(0, 0, 1, 0.5),
ItemsSource = new string[] { "Page background should be red", "ListView background should be blue with 50% alpha and so should appear purple", "[iOS, macOS] Default behavior is to make cells have the same color as the ListView, so the cells should appear 100% blue", "[Other platforms] Cells should be transparent, and appear purple", "If the cells appear pale blue, then the ListView has an extra white background", "If the cells appear dark blue, then the cells have the same blue with 50% alpha as a background", "If the ListView appears dark blue, then background colors with alpha is not supported" },
};
}
}
}

Просмотреть файл

@ -945,6 +945,7 @@
<DependentUpon>Issue4356.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)Issue5951.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Github6021.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Issue5132.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Issue5888.cs" />
</ItemGroup>

Просмотреть файл

@ -131,7 +131,8 @@ namespace Xamarin.Forms.Platform.MacOS
{
AutoresizingMask = NSViewResizingMask.HeightSizable | NSViewResizingMask.WidthSizable,
DocumentView = _table = CreateNSTableView(e.NewElement),
HasVerticalScroller = true
HasVerticalScroller = true,
DrawsBackground = false,
};
SetNativeControl(scroller);
}