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

[Bug] ListView can't change the RowHeight dynamic #8794

Closed
suihanhbr opened this issue Dec 8, 2019 · 6 comments
Closed

[Bug] ListView can't change the RowHeight dynamic #8794

suihanhbr opened this issue Dec 8, 2019 · 6 comments
Labels
a/listview Problems with the ListView/TableView p/iOS 🍎 t/bug 🐛

Comments

@suihanhbr
Copy link

Description

I'm implementing an effect that make ListView show any Element which has been hidden before. It work fine on Android but not on iOS. The Element can't display normally and can't interact with user.

Expected Behavior

It work fine on Android.
testlistviewmd5f4e4dfba74e19ee4effca363fa4b711a-MainActivity-12082019111139
When I click the "FIRST ITEM" Button , the label will show and the row height changed.
testlistviewmd5f4e4dfba74e19ee4effca363fa4b711a-MainActivity-12082019111128

Actual Behavior

But It don't work on iOS.
Simulator Screen Shot - iPhone 11 Pro Max - 2019-12-08 at 11 47 43

When I click the "First Item" Button, the Label showed but covered by the next ListCell and the row height do not changed.
Simulator Screen Shot - iPhone 11 Pro Max - 2019-12-08 at 11 47 45

Basic Information

=== Visual Studio Community 2019 for Mac ===

Version 8.3.10 (build 2)
Installation UUID: 4e60959a-758f-48ce-ae6d-26e15276ea83
GTK+ 2.24.23 (Raleigh theme)
Xamarin.Mac 5.16.1.24 (d16-3 / 08809f5b)

Package version: 604000208

=== Mono Framework MDK ===

Runtime:
Mono 6.4.0.208 (2019-06/07c23f2ca43) (64-bit)
Package version: 604000208

=== NuGet ===

Version: 5.3.0.6192

=== .NET Core SDK ===

SDK: /usr/local/share/dotnet/sdk/3.0.100/Sdks
SDK Versions:
3.0.100
3.0.100-preview5-011568
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/6.4.0/lib/mono/msbuild/Current/bin/Sdks

=== .NET Core Runtime ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
3.0.0
3.0.0-preview5-27626-15
2.1.13

=== Xamarin.Profiler ===

Version: 1.6.12.26
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Updater ===

Version: 11

=== Apple Developer Tools ===

Xcode 11.2.1 (15526.1)
Build 11B500

=== Xamarin.Mac ===

Version: 6.6.0.12 (Visual Studio Community)
Hash: e3c2b406d
Branch: xcode11.2
Build date: 2019-11-01 00:12:07-0400

=== Xamarin.iOS ===

Version: 13.6.0.12 (Visual Studio Community)
Hash: e3c2b406d
Branch: xcode11.2
Build date: 2019-11-01 00:12:08-0400

=== Xamarin Designer ===

Version: 16.3.0.256
Hash: 8a223bfd7
Branch: remotes/origin/d16-3
Build date: 2019-11-01 21:02:02 UTC

=== Xamarin.Android ===

Version: 10.0.6.2 (Visual Studio Community)
Commit: xamarin-android/d16-3/c407838
Android SDK: /Users/huangboru/myfile/sdk
Supported Android versions:
5.1 (API level 22)
6.0 (API level 23)
7.0 (API level 24)
7.1 (API level 25)
8.0 (API level 26)
8.1 (API level 27)

SDK Tools Version: 26.1.1
SDK Platform Tools Version: 29.0.5
SDK Build Tools Version: 29.0.2

Build Information:
Mono: mono/mono@476d72b9e32
Java.Interop: xamarin/java.interop/d16-3@5836f58
LibZipSharp: grendello/LibZipSharp/d16-3@71f4a94
LibZip: nih-at/libzip@b95cf3fd
ProGuard: xamarin/proguard@905836d
SQLite: xamarin/sqlite@8212a2d
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-3@cb41333

=== Microsoft Mobile OpenJDK ===

Java SDK: /Users/huangboru/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_8.0.25
1.8.0-25
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Android SDK Manager ===

Version: 1.4.0.65
Hash: c33b107
Branch: remotes/origin/d16-3
Build date: 2019-11-19 20:33:22 UTC

=== Android Device Manager ===

Version: 1.2.0.116
Hash: d2b2af0
Branch: remotes/origin/d16-3
Build date: 2019-11-19 20:33:42 UTC

=== Xamarin Inspector ===

Version: 1.4.3
Hash: db27525
Branch: 1.4-release
Build date: Mon, 09 Jul 2018 21:20:18 GMT
Client compatibility: 1

=== Build Information ===

Release ID: 803100002
Git revision: add3a4998a5cb5b081e0404e1fe13acfecb7801d
Build date: 2019-11-20 13:35:15+00
Build branch: release-8.3
Xamarin extensions: 79c69708816813b498283eeda7bcb4d464433a04

=== Operating System ===

Mac OS X 10.14.6
Darwin 18.7.0 Darwin Kernel Version 18.7.0
Sat Oct 12 00:02:19 PDT 2019
root:xnu-4903.278.12~1/RELEASE_X86_64 x86_64

=== Enabled user installed extensions ===

.NET Core support for Mono.Debugging 8.0.5
Open With 0.2
Log Monitor 0.1
NuGet Package Management Extensions 0.20

Reproduction Link

TestListView.zip

@suihanhbr suihanhbr added s/unverified New report that has yet to be verified t/bug 🐛 labels Dec 8, 2019
@kingces95
Copy link
Contributor

Build failure...

AppShell.xaml(50,17): error : Position 50:17. Type TabBar not found in xmlns http://xamarin.com/schemas/2014/forms

@samhouts samhouts added the a/listview Problems with the ListView/TableView label Dec 17, 2019
@kingces95
Copy link
Contributor

Hm, could you attach a version of the reproduction with the nuget package update to the lastest stable? I'm getting build errors I'm having trouble working around with the current solution.

@samhouts samhouts added p/iOS 🍎 s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. labels Dec 30, 2019
@nbevans
Copy link

nbevans commented Jan 19, 2020

#3769 (comment)

@samhouts samhouts removed the s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. label Jan 28, 2020
@samhouts samhouts removed the s/unverified New report that has yet to be verified label Feb 1, 2020
@samhouts
Copy link
Member

samhouts commented Feb 1, 2020

You need to call ForceUpdateSize on the ViewCell in order to get it to resize. Alternatively, please try the new CollectionView. Thanks!

@samhouts samhouts closed this as completed Feb 1, 2020
@DonatasUr
Copy link

You need to call ForceUpdateSize on the ViewCell in order to get it to resize. Alternatively, please try the new CollectionView. Thanks!

Hi,
ForceUpdateSize is a half solution for iOS (on Android listview auto resizing to highest inner element works well). The problem is iOS. In iOS ForceUpdateSize after 4-5 calls got dramatically slow and totally freezes app.
The usage of CollectionView is impossible too, because you are unable to get inner element by using a name x:Name="StackLayout123" (I dynamically add elements to layout so I need to get the element, flexlayout, stacklayout, button, etc.). Besides collectionview GetChildElements implementation put my hands down:
public virtual IList<GestureElement> GetChildElements(Point point) { return null; }
ListView CachingStrategy="RecycleElement" makes listview speed to normally, but it removes all element that was made unhidden (IsVisible="{Binding IsVisible}" to true). I'm suffering on this about a week with no way out.

@DonatasUr
Copy link

I finally find the way out. To make iOS redraw component with new size (flexlayout) need to set MinimumHeightRequest. This makes to redraw component again. My project components tree:
StackLayout
Pickers/Labels
StackLayout
StackLayout
Labels/Pickers
...
ListView
StackLayout
StackLayout
Labels/Buttons
FlexLayout <-- This must grow in height when first button is added and dynamically set MinimumHeightRequest
Dynamically added Buttons

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a/listview Problems with the ListView/TableView p/iOS 🍎 t/bug 🐛
Projects
None yet
Development

No branches or pull requests

5 participants