xamarin/Xamarin.Forms

[Bug] CollectionView EmptyViewTemplate not resizing accordingly when using WindowSoftInputModeAdjust.Resize

Open

#6,850 opened on Jul 10, 2019

 (2 comments) (0 reactions) (0 assignees)C# (1,926 forks)batch import
a/collectionviewe/4 :clock4:help wantedp/Androidt/bug :bug:up-for-grabs

Repository metrics

Stars
 (5,644 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

Description

CollectionView provides an EmptyViewTemplate to deal with empty datasource. However, when using WindowSoftInputModeAdjust.Resize (i.e., Android only), the provided EmptyView won't resize accordingly.

Steps to Reproduce

  1. Create a new ContentPage.
  2. Add a SearchBar.
  3. Add a CollectionView with some random ItemsSource and provide a EmptyView / EmptyViewTemplate.
  4. Add some logic to handle Searchbar input and update the ItemsSource of the CollectionView.
  5. Run the application.
  6. Focus on the Searchbar and type anything that will result in empty data source.
  7. The EmptyView is correctly rendered, filling the available space.
  8. Now, unfocus the Searchbar (i.e. hide the keyboard). The EmptyView won't resize.
  9. If you focus again on the Searchbar (i.e. show the keyboard), the EmptyView will then be resized and fit all the screen and part of the EmptyView will be under the keyboard.

Expected Behavior

The provided EmptyViewTemplate should be resized to fill all the available space.

Actual Behavior

The provided EmptyViewTemplate is not resized.

Basic Information

  • Version with issue: 4.1.0.581479
  • Platform Target Frameworks:
    • Android: 9.0

Screenshots

20190710_145550

Reproduction Link

CollectionView Resize Issue.zip

Contributor guide