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