xamarin/Xamarin.Forms

Hiding Bottom navigation view in android Tabbed page rendering Issue, Viewpages not full covered once bottom navigation hides

Ouverte

#4 222 ouverte le 26 oct. 2018

 (14 commentaires) (0 réaction) (0 personne assignée)C# (1 926 forks)batch import
e/3 :clock3:help wantedinactivep/Androidt/bug :bug:up-for-grabs

Métriques du dépôt

Stars
 (5 644 étoiles)
Métriques de merge PR
 (Métriques PR en attente)

Description

Here, The TabbedpageRendering in the Android for bottom navigation view , you are fixed the "FormsViewPager" is always top on the Bottom navigation bar.

https://github.com/xamarin/Xamarin.Forms/blob/master/Xamarin.Forms.Platform.Android/AppCompat/TabbedPageRenderer.cs Line no: 237 to 246 Method Name: protected override void OnElementChanged(ElementChangedEventArgs e)

var viewPagerParams = new AWidget.RelativeLayout.LayoutParams(LayoutParams.MatchParent, LayoutParams.MatchParent);
						viewPagerParams.AddRule(AWidget.LayoutRules.Above, _bottomNavigationView.Id);

						FormsViewPager pager = _viewPager = CreateFormsViewPager(activity, e.NewElement);

						pager.Id = Platform.GenerateViewId();
						pager.AddOnPageChangeListener(this);

						_relativeLayout.AddView(pager, viewPagerParams);
						_relativeLayout.AddView(_bottomNavigationView, bottomNavigationViewLayoutParams);

Line No:239to260 method Name:protected override void OnLayout(bool changed, int l, int t, int r, int b) And onlayout also you are fixed the viewpages top on bottum navigation, you want to hide the bottum naviagation , the viewpager not fully fitted the screen, it was shows the gap .

		if (IsBottomTabPlacement)
		{
			if (width <= 0 || height <= 0)
				return;

			_relativeLayout.Measure(
				MeasureSpec.MakeMeasureSpec(width, MeasureSpecMode.Exactly),
				MeasureSpec.MakeMeasureSpec(height, MeasureSpecMode.Exactly));

			pager.Measure(MeasureSpecFactory.MakeMeasureSpec(width, MeasureSpecMode.AtMost), MeasureSpecFactory.MakeMeasureSpec(height, MeasureSpecMode.AtMost));

			if (width > 0 && height > 0)
			{
				PageController.ContainerArea = new Rectangle(0, 0, context.FromPixels(width), context.FromPixels(height - _bottomNavigationView.MeasuredHeight));

				SetNavigationRendererPadding(0, _bottomNavigationView.MeasuredHeight);

				pager.Layout(0, 0, width, b);
				// We need to measure again to ensure that the tabs show up
				_relativeLayout.Measure(
					MeasureSpec.MakeMeasureSpec(width, MeasureSpecMode.Exactly),
					MeasureSpec.MakeMeasureSpec(height, MeasureSpecMode.Exactly));
				_relativeLayout.Layout(0, 0, _relativeLayout.MeasuredWidth, _relativeLayout.MeasuredHeight);
			}
		}

`

Guide contributeur