XamarinCommunityToolkit icon indicating copy to clipboard operation
XamarinCommunityToolkit copied to clipboard

[Bug] Space at the bottom of TabView

Open leo-mck opened this issue 5 years ago • 6 comments

If a page with a TabView has NavigationPage.HasNavigationBar="False", after navigating to a page with NavigationPage.HasNavigationBar="True" and coming back there is some empty space at the bottom:

Before navigating, the button occupies all space of the TabViewItem: screenshot-2020-11-28_21 21 45 807

After, there is a space at the bottom: screenshot-2020-11-28_21 21 57 249

NavigationPageSpace.zip

leo-mck avatar Nov 29 '20 00:11 leo-mck

Just found out that there is similar problem on iOS too. I am not sure if would be better to create a separate issue but I created another project with a reprodution of the problem. I have a main grid with 3 rows (Auto,*,Auto) and on the bottom row a expander. When the expander change size, the TabView does too but the content do not "redraw". On android, changing tabs corrects it but on iOS, it doesnt (the TabView BackgroundColor is "Blue"):

Android: tabview_android

iOS: tabview_ios

TabView2.zip

leo-mck avatar Jan 13 '21 17:01 leo-mck

I also have this issue in an app I'm working on.

Hackmodford avatar Nov 30 '21 20:11 Hackmodford

Same issue here. Easiest way to simulate:

  1. Create a new empty Xamarin app, add Community Toolkit
  2. In the MainPage copy the sample code from https://docs.microsoft.com/en-us/xamarin/community-toolkit/views/tabview
  3. Change the TabContentBackgroundColor on the MainPage to Cyan
  4. On the MainPage set NavigationPage.HasNavigationBar="false"
  5. In the app make the MainPage a NavigationPage: MainPage = new NavigationPage(new MainPage());
  6. Add a new empty SecondPage
  7. Add a button on the first tab view which navigates to SecondPage: await this.Navigation.PushAsync(new SecondPage());

Effect as shown:

On main page before opening the second page: image

On second page: image

After going back to main page -> problem is the cyan area below: image

Code of sample app attached. Bug 625 - Space at the bottom of TabView.zip

vppetrov avatar Feb 21 '22 14:02 vppetrov

has this bug fixed? I am also having it

dush135 avatar Jul 27 '22 03:07 dush135

Hi everyone, has there been any updates on this?

kunalprakash3891 avatar Feb 20 '23 13:02 kunalprakash3891

I've found that toggling the visibility of the element inside the TabViewItem to false then true when returning to the page overcomes this problem, it's a hack but it seems to work. For example if you have a ContentView inside your TabViewItem, do ContentView.IsVisible = false and then ContentView.IsVisible = true on the OnAppearing routine of the page containing the TabView.

kunalprakash3891 avatar Feb 20 '23 14:02 kunalprakash3891