зеркало из https://github.com/DeGsoft/maui-linux.git
Merge branch '4.1.0'
This commit is contained in:
Коммит
97a558a252
|
@ -82,8 +82,21 @@ namespace Xamarin.Forms.Platform.Android
|
||||||
|
|
||||||
internal SizeRequest GetDesiredSize(int widthConstraint, int heightConstraint)
|
internal SizeRequest GetDesiredSize(int widthConstraint, int heightConstraint)
|
||||||
{
|
{
|
||||||
|
var previousHeight = View.MeasuredHeight;
|
||||||
|
var previousWidth = View.MeasuredWidth;
|
||||||
|
|
||||||
View.Measure(widthConstraint, heightConstraint);
|
View.Measure(widthConstraint, heightConstraint);
|
||||||
|
|
||||||
|
// if the measure of the view has changed then trigger a request for layout
|
||||||
|
// if the measure hasn't changed then force a layout of the button
|
||||||
|
if (previousHeight != View.MeasuredHeight || previousWidth != View.MeasuredWidth)
|
||||||
|
{
|
||||||
|
if (!View.IsLayoutRequested)
|
||||||
|
View.RequestLayout();
|
||||||
|
}
|
||||||
|
else
|
||||||
View.ForceLayout();
|
View.ForceLayout();
|
||||||
|
|
||||||
return new SizeRequest(new Size(View.MeasuredWidth, View.MeasuredHeight), Size.Zero);
|
return new SizeRequest(new Size(View.MeasuredWidth, View.MeasuredHeight), Size.Zero);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче