nspopupbutton 行为不正常 - 反向显示

nspopupbutton not behaving properly - showing Reversely

我在我的 mac 应用程序之一中遇到 nspopupbutton 的独特问题。 我正在使用 table 视图来加载过滤器,具有不同选项的过滤器,我们可以 select 从下拉列表中选择选项。就像我在下面显示的那样。

我的问题是,在添加另一个过滤器(table 视图单元格)后,我的第一个单元格下拉文本显示反向。请在下面找到屏幕截图。

请分享你的想法,我真的被这个问题困住了。 仅在 High Sierra MacOS 中出现问题。

编辑 我正在 XIB 中创建自定义单元格,如下所示,并使用标签绑定 NS 元素

我用来加载table视图的代码

public override nint GetRowCount (NSTableView tableView)
            {
                return appliedFilters.Count;
            }


public override NSView GetViewForItem (NSTableView tableView, NSTableColumn tableColumn, nint row)
            {

var vw = (FiltersCell)tableView.MakeView (parentVC.appliedFilters.ElementAt((int)row), this);
 // Binddata is method I used to bind data in FIlterCell   
 vw.BindData (parentVC.appliedFilters [(int)row].ToString(), (int)row,parentVC);
 return vw;
 }

public override nfloat GetRowHeight (NSTableView tableView, nint row)
{

    return 30;
}

macOS HS 改变了许多基于层的东西,如果我们在某个地方使用 "old" NSCells,我不会感到惊讶,他们破坏了一些东西。

您可以尝试将您的父视图设置为基于图层(WantsLayer = true 或在 IB 中)并查看是否 "fixes" 事情。

多人在 HS 中遇到基于命中层的回归/问题(不是 Xamarin.Mac 中的错误)。

来自 xamarin 团队