summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.Android
diff options
context:
space:
mode:
authorPaul DiPietro <pauldipietro@users.noreply.github.com>2016-09-30 14:29:01 -0500
committerJason Smith <jason.smith@xamarin.com>2016-09-30 12:29:01 -0700
commitf1689cf0868ad15cae312402aa01735bbdb7e8bd (patch)
treeb29b7fcbae89f410ca10f276adb6058ff17f3d93 /Xamarin.Forms.Platform.Android
parent97bc024a0ede694d867e65568aa045acfa6b99b3 (diff)
downloadxamarin-forms-f1689cf0868ad15cae312402aa01735bbdb7e8bd.tar.gz
xamarin-forms-f1689cf0868ad15cae312402aa01735bbdb7e8bd.tar.bz2
xamarin-forms-f1689cf0868ad15cae312402aa01735bbdb7e8bd.zip
[A] Check for ViewStates.Gone in AppCompat TabbedPageRenderer (#365)
Diffstat (limited to 'Xamarin.Forms.Platform.Android')
-rw-r--r--Xamarin.Forms.Platform.Android/AppCompat/TabbedPageRenderer.cs13
1 files changed, 8 insertions, 5 deletions
diff --git a/Xamarin.Forms.Platform.Android/AppCompat/TabbedPageRenderer.cs b/Xamarin.Forms.Platform.Android/AppCompat/TabbedPageRenderer.cs
index ca0f7337..e2d47657 100644
--- a/Xamarin.Forms.Platform.Android/AppCompat/TabbedPageRenderer.cs
+++ b/Xamarin.Forms.Platform.Android/AppCompat/TabbedPageRenderer.cs
@@ -209,11 +209,14 @@ namespace Xamarin.Forms.Platform.Android.AppCompat
tabs.Measure(MeasureSpecFactory.MakeMeasureSpec(width, MeasureSpecMode.Exactly), MeasureSpecFactory.MakeMeasureSpec(height, MeasureSpecMode.AtMost));
var tabsHeight = 0;
- //MinimumHeight is only available on API 16+
- if ((int)Build.VERSION.SdkInt >= 16)
- tabsHeight = Math.Min(height, Math.Max(tabs.MeasuredHeight, tabs.MinimumHeight));
- else
- tabsHeight = Math.Min(height, tabs.MeasuredHeight);
+ if (tabs.Visibility != ViewStates.Gone)
+ {
+ //MinimumHeight is only available on API 16+
+ if ((int)Build.VERSION.SdkInt >= 16)
+ tabsHeight = Math.Min(height, Math.Max(tabs.MeasuredHeight, tabs.MinimumHeight));
+ else
+ tabsHeight = Math.Min(height, tabs.MeasuredHeight);
+ }
pager.Measure(MeasureSpecFactory.MakeMeasureSpec(width, MeasureSpecMode.AtMost), MeasureSpecFactory.MakeMeasureSpec(height, MeasureSpecMode.AtMost));