Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug][Android] Handling visibility of a child in DataTemplate of a custom control not works properly. #9354

Closed
gokulsaravanan opened this issue Jan 29, 2020 · 1 comment
Labels

Comments

@gokulsaravanan
Copy link

Description

In our custom control, we are providing the DataTemplate property for view customization support.
When handling the visibility of a child through binding it does not work properly.

If we set the IsVisible to the view initially as 'True' it works fine when changing visibility a run time. But when visibility is 'false' when control is loaded and changing its value at run time, doesn't works.

Steps to Reproduce

  1. Run the sample.
  2. Click on the open button to navigate to the page, where the control is loaded.
  3. Click the change visibility button to change the visibility of the grid, loaded inside the template.
  4. You can see the changing visibility works for items to which the grid is visible at initial loading, but others, not works.

Expected Behavior

The visibility of the item should change when changed.

Actual Behavior

Grid is not visible when set IsVisible as true in button clicked event until you rotate the screen.

Basic Information

  • IDE: VS2019
  • Platform Target Frameworks:
    • Android: 9.1
  • Nuget Packages: Xamarin.Forms 3.6.0.344457

Screenshots

Attached the issue reproducible video in the below attachment.

Reproduction Link

Visibility_Issue.zip

IssueVideo

@gokulsaravanan gokulsaravanan added s/unverified New report that has yet to be verified t/bug 🐛 labels Jan 29, 2020
@pauldipietro pauldipietro added this to New in Triage Jan 29, 2020
@PureWeen
Copy link
Contributor

I changed over your custom layout to use a collectionview with data templates and it works fine there. So this is going to be something that's wrong with your custom layout code that's most likely not resizing the container when the grids visibility changes.

When the grids visibility is zero it has no bounds and then when it changes it gets remeasured. I'm guessing the parent container isn't reacting to this

595A86F0-B4B5-4D67-B240-CFB51012B1C7

Triage automation moved this from New to Closed Feb 22, 2020
@samhouts samhouts removed this from Closed in Triage Mar 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants