xamarin/Xamarin.Forms

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

Aperta

#6850 aperta il 10 lug 2019

 (2 commenti) (0 reazioni) (0 assegnatari)C# (1926 fork)batch import
a/collectionviewe/4 :clock4:help wantedp/Androidt/bug :bug:up-for-grabs

Metriche repository

Star
 (5644 stelle)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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

Guida contributor