|
using CoreGraphics;
using Foundation;
using ObjCRuntime;
using UIKit;
namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS
{
[System.Obsolete]
internal sealed class VerticalCell : WidthConstrainedTemplatedCell
{
public static NSString ReuseId = new NSString("Microsoft.Maui.Controls.Compatibility.Platform.iOS.VerticalCell");
[Export("initWithFrame:")]
[Microsoft.Maui.Controls.Internals.Preserve(Conditional = true)]
public VerticalCell(CGRect frame) : base(frame)
{
}
public override CGSize Measure()
{
var measure = VisualElementRenderer.Element.Measure(ConstrainedDimension,
double.PositiveInfinity, MeasureFlags.IncludeMargins);
return new CGSize(ConstrainedDimension, measure.Request.Height);
}
protected override bool AttributesConsistentWithConstrainedDimension(UICollectionViewLayoutAttributes attributes)
{
return attributes.Frame.Width == ConstrainedDimension;
}
}
} |