Skip to content

Commit

Permalink
fix Android Measure
Browse files Browse the repository at this point in the history
  • Loading branch information
muak committed Apr 27, 2023
1 parent 35d1d6e commit 27aaa51
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions SettingsView/Platforms/Android/HeaderFooterContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ protected override void OnMeasure(int widthMeasureSpec, int heightMeasureSpec)
return;
}

var size = _viewHandler.MeasureVirtualView(widthMeasureSpec, heightMeasureSpec);
int height = (int)size.Height;
var size = _viewHandler.VirtualView.Measure(width, double.PositiveInfinity);
int height = (int)Context.ToPixels(size.Height);

SetMeasuredDimension(width, height);
}
Expand Down Expand Up @@ -172,12 +172,20 @@ public void DisconnectHandler()
protected virtual void CreateNewHandler(View view)
{
_contentView = view;

_contentView.MeasureInvalidated += _contentView_MeasureInvalidated;

var platformView = _contentView.ToPlatform(view.FindMauiContext());
_viewHandler = (IPlatformViewHandler)_contentView.Handler;
AddView(platformView);
UpdateNativeCell();
}

private void _contentView_MeasureInvalidated(object sender, EventArgs e)
{
;
}

public override void AddView(AView child)
{
base.AddView(child);
Expand Down

0 comments on commit 27aaa51

Please sign in to comment.