0

Xamarin.forms プロジェクトを作成し、iOS では正常に動作する DataTemplateSelector を作成しましたが、Andoird ではアプリを高速にスクロールするとクラッシュしませんが、低速でスクロールするとアプリがクラッシュし、TargetInvocationException が発生します。エラーを追跡することさえできず、エラーが発生したときにそのエラーの選択を追跡することさえできません。スクロールが速くなったり遅くなったりしても、同じデータでクラッシュしない場合があり、スクロールしようとすると同じデータですぐにクラッシュする場合があります若干。

エラーをログに記録しました。以下はログのエラーです。

Time: 12/14/2016 1:37:48 PM
Error: Unhandled Exception
System.Exception: CurrentDomainOnUnhandledException ---> Java.Lang.RuntimeException: java.lang.reflect.InvocationTargetException ---> Java.Lang.Reflect.InvocationTargetException: Exception of type 'Java.Lang.Reflect.InvocationTargetException' was thrown. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
  at System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) [0x00011] in <368820a9888f43ddb85d18e87189adbf>:0 
  at System.ThrowHelper.ThrowArgumentOutOfRangeException () [0x00000] in <368820a9888f43ddb85d18e87189adbf>:0 
  at System.Collections.Generic.List`1[T].get_Item (System.Int32 index) [0x0000c] in <368820a9888f43ddb85d18e87189adbf>:0 
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in <368820a9888f43ddb85d18e87189adbf>:0 
   --- End of inner exception stack trace ---
  at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00056] in <368820a9888f43ddb85d18e87189adbf>:0 
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <368820a9888f43ddb85d18e87189adbf>:0 
  at Xamarin.Forms.BindingExpression+BindingExpressionPart.TryGetValue (System.Object source, System.Object& value) [0x00026] in <7b0368eb3d0f405da776a09e3171532a>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <368820a9888f43ddb85d18e87189adbf>:0 
  at Java.Interop.JniEnvironment+InstanceMethods.CallNonvirtualBooleanMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniObjectReference type, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x000a8] in <a043032cf94a485190047a14918b9f60>:0 
  at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualBooleanMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x00068] in <a043032cf94a485190047a14918b9f60>:0 
  at Android.Views.View.DispatchTouchEvent (Android.Views.MotionEvent e) [0x00036] in <206240d88f7f44d795aacbc1d5348a1f>:0 
  at Xamarin.Forms.Platform.Android.PlatformRenderer.DispatchTouchEvent (Android.Views.MotionEvent e) [0x00035] in <d572ae0ccf89437fad1de1370c623a06>:0 
  at Android.Views.View.n_DispatchTouchEvent_Landroid_view_MotionEvent_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_e) [0x00011] in <206240d88f7f44d795aacbc1d5348a1f>:0 
  at (wrapper dynamic-method) System.Object:035bfbdb-dd96-451c-b894-4f2fd770769d (intptr,intptr,intptr)
   --- End of inner exception stack trace ---
   --- End of inner exception stack trace ---
   --- End of inner exception stack trace ---

以下はxaml.csファイルのコードです

http://pastebin.com/UvyxMwtP

以下はxamlファイルのコードです

http://pastebin.com/VVfKAjnn

以下はDataTemplateSelectorのコードです

http://pastebin.com/nn2dGZAW

以下はテンプレートのコードです。

http://pastebin.com/0mJD1gJ1 http://pastebin.com/uJiLnBKK http://pastebin.com/gcj2TuJ1 http://pastebin.com/c8TByW1z http://pastebin.com/ww51B4Su

4

0 に答える 0