Bug 39406 - IsVisible doesn't work on ListView and Grid on some Android versions
Summary: IsVisible doesn't work on ListView and Grid on some Android versions
Status: RESOLVED NORESPONSE
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.0.0
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Jason Smith [MSFT]
URL:
Depends on:
Blocks:
 
Reported: 2016-03-07 12:42 UTC by Willem Mali
Modified: 2017-06-19 21:22 UTC (History)
5 users (show)

Tags: appcompat forms android
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED NORESPONSE

Description Willem Mali 2016-03-07 12:42:46 UTC
Copied from my forum post:

Hi, I'm having trouble implementing a tabbed view inside a ContentPage. The reason I'm not using the TabbedPage is that I need a header with an image above the tab bar. I have a Grid which contains both a Grid and a ListView, both set to the same row and column, and I want to only make one visible at a time, depending on the ViewModel's Tab property, which is changed with SetTabCommand.
I have verified that SetTabCommand changes the value of Tab, that the converters are called and that they return the correct values. However, neither of the views who're supposed to toggle between visible and invisible change in any way. I've tried commenting out both the inner Grid and the ListView individually, and their visibility doesn't change when I press the navigation buttons. If I don't uncomment either I only see the ListView.

Here's the layout of my xaml:

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage>
  <ContentPage.Resources>
    <ResourceDictionary>
      <converters:PropertyMatchToBoolConverter x:Key="TabToVisibilityConverter" />
    </ResourceDictionary>
  </ContentPage.Resources>
  <Grid>
    <Grid>
      <Image>
      </Image>
      <Grid>
        <Label>
        </Label>
        <Button Command="{Binding SetTabCommand}" CommandParameter="0">
        </Button>
        <Button Command="{Binding SetTabCommand}" CommandParameter="1">
        </Button>
      </Grid>
    </Grid>
    <ListView
      IsVisible="{Binding Tab, Converter={StaticResource TabToVisibilityConverter}, ConverterParameter=0}"
      >
      <ListView.ItemTemplate>
        <DataTemplate>
          <ViewCell>
          </ViewCell>
        </DataTemplate>
      </ListView.ItemTemplate>
    </ListView>
    <Grid
      IsVisible="{Binding Tab, Converter={StaticResource TabToVisibilityConverter}, ConverterParameter=1}"
      >
    </Grid>
  </Grid
</ContentPage>

I omitted row/column definition and a bunch of other irrelevant properties; if you feel like anything's missing I could add that back in or post the real xaml, though it is 150 lines.


Aditional info:
After I made my forum post I accidentally discovered that this does work on an older model Android phone I had lying around. The phone it didn't work on was a fully up-to-date Samsung Galaxy S6, the one it did work on was a Samsung Galaxy Note S5 4G LTE. I'm using the AppCompat library provided by Xamarin.

If it'd help I could provide additional code samples. Could you point me to a way to work around this if this will take long to be fixed? It's a blocking issue for me at the moment.
Comment 1 Jason Smith [MSFT] 2016-03-10 20:13:28 UTC
I can't seem to reproduce this with my local build of your test, would you mind sending me your project with the reproduction?
Comment 2 Chris King 2017-06-19 17:22:32 UTC
Assigned to you as you were last to request additional info.
Comment 3 Samantha Houts [MSFT] 2017-06-19 21:22:48 UTC
Because we have not received a reply to our request for more information we are closing this issue. If you are still encountering this issue, please reopen the ticket with the requested information. Thanks!