Xamarin.forms: iOS:ContextAction集合更改会导致速度变慢并最终冻结

创建于 2018-03-12  ·  3评论  ·  资料来源: xamarin/Xamarin.Forms

描述

ListView或TableView中对ContextAction的每次更改都会导致iOS上的UI冻结成指数增加。

重现步骤

  1. 使用上下文操作创建一个ViewCell
  2. 以某种方式重复更改上下文操作(通常基于ViewCell / ViewModel状态)

预期行为

上下文菜单(在iOS上向左滑动,在Android上按住,在UWP上单击鼠标右键等)应立即反映此更改,而不会降低UI速度。

实际行为

在iOS上,每次更改时,UI的响应速度都会越来越慢,直到最终无限期冻结为止。

基本信息

  • 有问题的版本:2.5.0.280555
  • IDE:Visual Studio 2017
  • 平台目标框架:

    • iOS:11.8.0.20

  • 设备:在iPhone 6 Plus上测试

视频

https://github.com/sonic1015/bugRepo/files/1835039/2018-03-12.T16-17-07.zip

复制链接

https://github.com/sonic1015/bugRepo/archive/1.zip

listview performance 4 help wanted high iOS 🍎 bug up-for-grabs

所有3条评论

你好,

我也遇到了这个完全相同的问题,我想知道您什么时候才能真正解决这个问题

这个问题似乎已经很长时间没有任何活动了。 我们正在努力确定问题的优先级,并尽快解决它们。 为了帮助我们了解清单,很高兴收到您的更新,以告知您这是否仍在最新版本的Xamarin.Forms上影响您,因为我们可能已经解决了此问题,这是另一个相关或重复的内容问题。 如果在接下来的30天内看不到有关此问题的任何新活动,我们将评估是否应该解决此问题。 谢谢!

将复制版本更新为Xamarin.Forms v4.6.0.867

更改第一个菜单项后,菜单关闭时没有动画。 更改约7个菜单项后,它会崩溃,但以下情况除外:

System.NullReferenceException: Object reference not set to an instance of an object
  at Xamarin.Forms.Platform.iOS.ContextActionsCell.OnCellPropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs e) [0x00012] in D:\a\1\s\Xamarin.Forms.Platform.iOS\ContextActionCell.cs:475 
  at (wrapper delegate-invoke) <Module>.invoke_void_object_PropertyChangedEventArgs(object,System.ComponentModel.PropertyChangedEventArgs)
  at Xamarin.Forms.BindableObject.OnPropertyChanged (System.String propertyName) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:229 
  at Xamarin.Forms.Element.OnPropertyChanged (System.String propertyName) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:353 
  at Xamarin.Forms.Cell.OnContextActionsChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x0002d] in D:\a\1\s\Xamarin.Forms.Core\Cells\Cell.cs:227 
  at (wrapper delegate-invoke) <Module>.invoke_void_object_NotifyCollectionChangedEventArgs(object,System.Collections.Specialized.NotifyCollectionChangedEventArgs)
  at System.Collections.ObjectModel.ObservableCollection`1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x00018] in <866ebc6712e548788bfc4c085907ae80>:0 
  at System.Collections.ObjectModel.ObservableCollection`1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedAction action, System.Object item, System.Int32 index) [0x00009] in <866ebc6712e548788bfc4c085907ae80>:0 
  at System.Collections.ObjectModel.ObservableCollection`1[T].RemoveItem (System.Int32 index) [0x00021] in <866ebc6712e548788bfc4c085907ae80>:0 
  at System.Collections.ObjectModel.Collection`1[T].Remove (T item) [0x00027] in <624bcc4ce53347508a7b8fa821d78da4>:0 
  at bugRepo.CustomViewCell+<>c__DisplayClass0_0.<.ctor>b__1 (System.Object sender, System.EventArgs args) [0x00002] in C:\Users\eballantyne\Downloads\bugRepo-1\bugRepo-1\bugRepo\bugRepo\CustomViewCell.xaml.cs:40 

在iPhone 8,iOS 13.4.1上进行了测试。 尚未在Android或UWP上进行测试。

此页面是否有帮助?
0 / 5 - 0 等级