如何将LargestUndimmedDetentIdentifier与自定义图纸演示高度配合使用?
我有一个UISheetPresentationController,它有两个自定义制动器,但我不知道如何与下面的内容交互。
UISheetPresentationController sheet = NavigationController!.SheetPresentationController!;
sheet.PrefersGrabberVisible = true;
sheet.PrefersScrollingExpandsWhenScrolledToEdge = false;
sheet.WidthFollowsPreferredContentSizeWhenEdgeAttached = true;
sheet.Delegate = new SheetPresentationControllerDelegate();
UISheetPresentationControllerDetent smallDetent = UISheetPresentationControllerDetent.Create("small", _ => 60);
UISheetPresentationControllerDetent msmallPlusDetent = UISheetPresentationControllerDetent.Create("smallPlus", _ => 350);
sheet.Detents = new UISheetPresentationControllerDetent[]
{
smallDetent,
msmallPlusDetent
};
sheet.LargestUndimmedDetentIdentifier = ????; (what can I put here?)
1条答案
按热度按时间hyrbngr71#
您自定义的detents height是一个对象,表示表单自然停留的高度,
LargeUndimmedDetentIdentifier
属性需要是UISheetPresentationControllerDetentIdentifier
的一个枚举,它的作用是不会使表单下面的视图变暗,目前iOS只定义了Medium和Large两个枚举类型,暂时没有办法自定义更改,只能使用这两种方式:sheet.LargestUndimmedDetentIdentifier=UISheetPresentationControllerDetentIdentifier.Medium/Large
有关详细信息,请参阅:
largestUndimmedDetentIdentifier | AppleDeveloper
UISheetPresentationControllerDetentIdentifier | AppleDeveloper