Xamarin.Forms 2.1.0-pre5 Released

124

Posts

  • rogiheerogihee NLMember ✭✭✭

    I'm rewriting my bindings to non-generic version, but I seem to get an argument exception always when I try to set a default value:

    public static readonly BindableProperty FontSizeProperty = BindableProperty.Create(nameof(FontSize), typeof(DigitLabel), typeof(double), 23d, BindingMode.OneWay, null, OnFontSizePropertyChanged);

    System.ArgumentException: Default value did not match return type
    Any idea why?

  • JMarcusJMarcus USMember ✭✭✭

    @RogiervanderHee You've got your types swapped. Switch DigitLabel and double in your example.

  • rogiheerogihee NLMember ✭✭✭

    @JMarcus: ah, got it. Thanks!

  • DH_HA1DH_HA1 USMember ✭✭✭

    @JMarcus here is a code snippet I use in Xam Studio to create these quickly

    <?xml version="1.0" encoding="utf-8"?>
    <CodeTemplates version="3.0">
      <CodeTemplate version="2.0">
        <Header>
          <_Group>C#</_Group>
          <Version />
          <MimeType>text/x-csharp</MimeType>
          <Shortcut>bprop</Shortcut>
          <_Description />
          <TemplateType>Expansion</TemplateType>
        </Header>
        <Variables>
          <Variable name="name">
            <Default>notset</Default>
          </Variable>
          <Variable name="view">
            <Default>notset</Default>
          </Variable>
          <Variable name="type">
            <Default>string</Default>
          </Variable>
          <Variable name="classname" isEditable="false">
            <Default>notset</Default>
            <Function>GetCurrentClassName()</Function>
          </Variable>
        </Variables>
        <Code><![CDATA[
    
            public static readonly BindableProperty $name$Property =
                BindableProperty.Create (nameof($name$), typeof($type$), typeof($classname$), null, BindingMode.OneWay);
    
            public $type$ $name$
            {
                get { return ($type$)GetValue ($name$Property); }
                set { SetValue ($name$Property, value); }
            }]]>
      
    
    
  • I think I found a regression on UWP.. can't change detail in a master-detail system...
    Bugzilla : https://bugzilla.xamarin.com/show_bug.cgi?id=38505

  • Shane000Shane000 USMember ✭✭✭

    Wait, so the Generic version of BindableProperty.Create is deprecated? Like this?

        public static readonly BindableProperty StrokeWidthProperty = 
            BindableProperty.Create<BaseEntry, int> (prop => prop.StrokeWidth, 1);
    
  • MichaelRumplerMichaelRumpler ATMember ✭✭✭✭

    @BradChase.2654 You have to mutate the Drawable otherwise the color is changed for all Drawables with this resource id (=all instances of the same images). See this SO answer.

    // If we don't mutate the drawable, then all drawable's with this id will have a color
    // filter applied to it.
    drawable.mutate();
    drawable.setColorFilter(color, PorterDuff.Mode.SRC_ATOP);
    
  • MarcoTMarcoT USMember ✭✭

    Every time I try to export an apk I receive this error:

    The "XamlCTask" task could not be instantiated from "...\packages\Xamarin.Forms.2.1.0.6508-pre3\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.Build.Tasks.dll". Object reference not set to an instance of an object.
    The "XamlCTask" task has been declared or used incorrectly, or failed during construction. Check the spelling of the task name and the assembly name.

    Inside my project I don't use xaml, only code. Usually to "solve" this problem, I clean the project and restart my machine.

    How can I solve this error?

  • BradChase.2654BradChase.2654 USMember ✭✭✭

    @MichaelRumpler said:
    @BradChase.2654 You have to mutate the Drawable otherwise the color is changed for all Drawables with this resource id (=all instances of the same images). See this SO answer.

    // If we don't mutate the drawable, then all drawable's with this id will have a color
    // filter applied to it.
    drawable.mutate();
    drawable.setColorFilter(color, PorterDuff.Mode.SRC_ATOP);
    

    You are the man! I will test this out on Monday. How come I have never heard of this before?! Crazy. I'm glad the error is on my end.

    Brad

  • AnthonyRamirezAnthonyRamirez USUniversity ✭✭✭

    @ShanePope correct. Looks like on iOS AOT it creates assembly bloat.

  • alexrainmanalexrainman USMember ✭✭

    @CraigDunn how to apply effect to StackLayout? like, borders for example.

  • JKayJKay USMember ✭✭✭
    edited February 2016

    Is what @ShanePope saying correct, that BindableProperty.Create<BaseEntry, int> (prop => prop.StrokeWidth, 1) has been deprecated?

    I have used this technique in ALL of my custom controls and can see 0 mention of this anywhere, apart from 1 small comment in the depths of this thread (which will obviously disappear into the abyss after the next release).

    Please document this with the correct way to rectify it.

    Documentation is AS, if not MORE important than the code itself when writing API's!

  • MichaelRumplerMichaelRumpler ATMember ✭✭✭✭

    @JKay @ShanePope This is mentioned in the very first post of this thread under "Other Improvements". There has already been an extensive discussion here.

  • BradChase.2654BradChase.2654 USMember ✭✭✭

    @MichaelRumpler Ok so I have the same issue with the code change. Here is the code:

    EditText test = this.Control as EditText; Drawable drawable = test.Background.Mutate( ); drawable.SetColorFilter(Color.Green.ToAndroid( ), PorterDuff.Mode.SrcAtop);

    It still changes them the color for all controls. Ideas?

  • MichaelRumplerMichaelRumpler ATMember ✭✭✭✭

    I'm not very comfortable with this either. I just saw that SO article the other day.
    If I understood it correctly, then you have to do

    var drawable = test.Background;
    drawable.Mutate();
    drawable.SetColorFilter(Color.Green.ToAndroid( ), PorterDuff.Mode.SrcAtop);
    test.Background = drawable;
    

    You may be able to find the answer on the Android Developers Blog.

  • BradChase.2654BradChase.2654 USMember ✭✭✭
    edited February 2016

    @MichaelRumpler That makes sense because it is mutating, but the interesting part is I was doing that the first time on the mutate and then took it off because the color was still changing. So you can literally just mutate and then change the value on the return from the mutate and all the drawables will change! Thats without even setting the drawable back to the background. Seems like Mutate is not actually mutating at all! Is this a Xamarin issue or an Android issue you think?

    EDIT: I wonder if the line is a bitmap?

  • MichaelRumplerMichaelRumpler ATMember ✭✭✭✭

    @BradChase.2654 Mutate() is a pure Android thing. It is explained at the link I posted last time. It does not clone the object, it only changes some internal state of it. So the assignment back may not be needed, but it may trigger a PropertyChanged event (depends on the implementation). As I already said, these are just guesses. I didn't try it myself. I plan to implement tinting next, but didn't do it yet.

  • MarcoTMarcoT USMember ✭✭

    On windows phone,
    If you put a button inside a layout (Relative or absolute) that is inside a scrollview, then you can't set a dimension on this button.

    The same code works perfectly on iOS and Android.

  • KasperOvergrdNielsenKasperOvergrdNielsen DKBeta, University ✭✭

    It seems tradition to raise bugs against pre-releases in the pre-release forum thread, and since it is currently not possible to do so in bugzilla, I will do so as well. Please advice if we should follow a different procedure.

    Anyway..

    When adding lots of pins to a map on Android, moving to center on latest pin, and navigating to and from the page containing the Map view, I eventually experience the following crash with 2.1.0-pre4. I'm not sure it is a regression since pre3, but this is now the crash I see most frequently (it is fairly rare).

    I have a hunch it is caused by MapRenderer.n_onCameraChange(Native Method)

    Here is it the interesting bits from adb logcat:

    02-10 10:40:52.310  2481  2481 D AndroidRuntime: Shutting down VM
    02-10 10:40:52.336  2481  2481 I mono-stdout: RootDomain
    02-10 10:40:52.337  2481  2481 I mono-stdout: System.UnhandledExceptionEventArgs
    02-10 10:40:52.377  2481  2481 E AndroidRuntime: FATAL EXCEPTION: main
    02-10 10:40:52.377  2481  2481 E AndroidRuntime: Process: XamarinPoC.Android, PID: 2481
    02-10 10:40:52.377  2481  2481 E AndroidRuntime: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
    02-10 10:40:52.377  2481  2481 E AndroidRuntime:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
    02-10 10:40:52.377  2481  2481 E AndroidRuntime: Caused by: java.lang.reflect.InvocationTargetException
    02-10 10:40:52.377  2481  2481 E AndroidRuntime:    at java.lang.reflect.Method.invoke(Native Method)
    02-10 10:40:52.377  2481  2481 E AndroidRuntime:    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
    02-10 10:40:52.377  2481  2481 E AndroidRuntime:    ... 1 more
    02-10 10:40:52.377  2481  2481 E AndroidRuntime: Caused by: md52ce486a14f4bcd95899665e9d932190b.JavaProxyThrowable: System.NotSupportedException: Unable to activate instance of type Xamarin.Forms.Maps.Android.MapRenderer from native handle 0xffedf85c (key_handle 0x1c9d9fe). ---> System.MissingMethodException: No constructor found for Xamarin.Forms.Maps.Android.MapRenderer::.ctor(System.IntPtr, Android.Runtime.JniHandleOwnership) ---> Java.Interop.JavaLocationException: Exception of type 'Java.Interop.JavaLocationException' was thrown.
    02-10 10:40:52.377  2481  2481 E AndroidRuntime: Java.Lang.Error: Exception of type 'Java.Lang.Error' was thrown.
    02-10 10:40:52.377  2481  2481 E AndroidRuntime: 
    02-10 10:40:52.377  2481  2481 E AndroidRuntime:   --- End of managed exception stack trace ---
    02-10 10:40:52.377  2481  2481 E AndroidRuntime: java.lang.Error: Java callstack:
    02-10 10:40:52.377  2481  2481 E AndroidRuntime:    at md5d956392b2b421ac2c9ccfc063253dcd9.MapRenderer.n_onCameraChange(Native Method)
    02-10 10:40:52.377  2481  2481 E AndroidRuntime:    at md5d956392b2b421ac2c9ccfc063253dcd9.MapRenderer.onCameraChange(MapRenderer.java:54)
    02-10 10:40:52.377  2481  2481 E AndroidRuntime:    at com.google.android.gms.maps.GoogleMap$7.onCameraChange(Unknown Source)
    02-10 10:40:52.377  2481  2481 E AndroidRuntime:    at com.google.android.gms.maps.internal.zze$zza.onTransact(Unknown Source)
    02-10 10:40:52.377  2481  2481 E AndroidRuntime:    at android.os.Binder.transact(Binder.java:387)
    02-10 10:40:52.377  2481  2481 E AndroidRuntime:    at com.google.android.gms.maps.internal.aa.a(SourceFile:93)
    02-10 10:40:52.377  2481  2481 E AndroidRuntime:    at com.google.maps.api.android.lib6.gmm6.c.a.a(Unknown Source)
    02-10 10:40:52.377  2481  2481 E AndroidRuntime:    at com.google.maps.api.android.lib6.gmm6.c.b.run(Unknown Source)
    02-10 10:40:52.377  2481  2481 E AndroidRuntime:    at android.os.Handler.handleCallback(Handler.java:739)
    02-10 10:40:52.377  2481  2481 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Handler.java:95)
    02-10 10:40:52.377  2481  2481 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:148)
    02-10 10:40:52.377  2481  2481 E AndroidRuntime:    at android.app.ActivityThread.main(ActivityThread.java:5417)
    02-10 10:40:52.377  2481  2481 E AndroidRuntime:    at java.lang.reflect.Method.invoke(Native Method)
    02-10 10:40:52.377  2481  2481 E AndroidRuntime:    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
    02-10 10:40:52.377  2481  2481 E AndroidRuntime:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
    02-10 10:40:52.377  2481  2481 E AndroidRuntime: 
    02-10 10:40:52.377  2481  2481 E AndroidRuntime:   --- End of inner exception stack trace ---
    02-10 10:40:52.377  2481  2481 E AndroidRuntime:   at Java.Interop.TypeManager.CreateProxy (System.Type type, IntPtr handle, JniHandleOwnership transfer) <0xd7174eb8 + 0x00208> in <filename unknown>:0 
    02-10 10:40:52.377  2481  2481 E AndroidRuntime:   at Java.Interop.TypeManager.CreateInstance (IntPtr handle, JniHandleOwnership transfer, System.Type targetType) <0xf3de5280 + 0x0023f> in <filename unknown>:0 
    02-10 10:40:52.377  2481  2481 E AndroidRuntime:   --- End of inner exception stack trace ---
    02-10 10:40:52.377  2481  2481 E AndroidRuntime:   at Java.Interop.TypeManager.CreateInstance (IntPtr handle, JniHandleOwnership transfer, System.Type targetType) <0xf3de5280 + 0x00548> in <filename unknown>:0 
    02-10 10:40:52.377  2481  2481 E AndroidRuntime:   at Java.Lang.Object.GetObject (IntPtr handle, JniHandleOwnership transfer, System.Type type) <0xf3de4720 + 0x00307> in <filename unknown>:0 
    02-10 10:40:52.377  2481  2481 E AndroidRuntime:   at Java.Lang.Object._GetObject[T] (IntPtr handle, JniHandleOwnership transfer) <0xf3de4590 + 0x0004f> in <filename unknown>:0 
    02-10 10:40:52.377  2481  2481 E AndroidRuntime:   at Java.Lang.Object.GetObject[T] (IntPtr handle, JniHandleOwnership transfer) <0xf3de4398 + 0x0002b> in <filename unknown>:0 
    02-10 10:40:52.377  2481  2481 E AndroidRuntime:   at Java.Lang.Object.GetObject[T] (IntPtr jnienv, IntPtr handle, JniHandleOwnership transfer) <0xd6d122d8 + 0x00037> in <filename unknown>:0 
    02-10 10:40:52.377  2481  2481 E AndroidRuntime:   at Android.Gms.Maps.GoogleMap+IOnCameraChangeListenerInvoker.n_OnCameraChange_Lcom_google_android_gms_maps_model_CameraPosition_ (IntPtr jnienv, IntPtr native__this, IntPtr native_position) <0xcc989d48 + 0x00033> in <filename unknown>:0 
    02-10 10:40:52.377  2481  2481 E AndroidRuntime:   at (wrapper dynamic-method) System.Object:a44543ce-9f04-465e-9d31-5bd8db183023 (intptr,intptr,intptr)
    02-10 10:40:52.377  2481  2481 E AndroidRuntime:    at md5d956392b2b421ac2c9ccfc063253dcd9.MapRenderer.n_onCameraChange(Native Method)
    02-10 10:40:52.377  2481  2481 E AndroidRuntime:    at md5d956392b2b421ac2c9ccfc063253dcd9.MapRenderer.onCameraChange(MapRenderer.java:54)
    02-10 10:40:52.377  2481  2481 E AndroidRuntime:    at com.google.android.gms.maps.GoogleMap$7.onCameraChange(Unknown Source)
    02-10 10:40:52.377  2481  2481 E AndroidRuntime:    at com.google.android.gms.maps.internal.zze$zza.onTransact(Unknown Source)
    02-10 10:40:52.377  2481  2481 E AndroidRuntime:    at android.os.Binder.transact(Binder.java:387)
    02-10 10:40:52.377  2481  2481 E AndroidRuntime:    at com.google.android.gms.maps.internal.aa.a(SourceFile:93)
    02-10 10:40:52.377  2481  2481 E AndroidRuntime:    at com.google.maps.api.android.lib6.gmm6.c.a.a(Unknown Source)
    02-10 10:40:52.377  2481  2481 E AndroidRuntime:    at com.google.maps.api.android.lib6.gmm6.c.b.run(Unknown Source)
    02-10 10:40:52.377  2481  2481 E AndroidRuntime:    at android.os.Handler.h
    02-10 10:40:52.463   896  3820 W ActivityManager:   Force finishing activity XamarinPoC.Android/md5f488a44b4a752da26bb3ba74d5a07b06.MainActivity
    
  • MarkoLudolphMarkoLudolph DEMember ✭✭

    @BryanHunter.xam I have a MasterDetailPage on UWP, the Master is a ContentPage, Detail is a NavigationPage. The problem is, as you can see on the screenshots, when I set the BarBackgroundColor the menu button stays black and there is a black stripe on the menu page when I set the BackgroundColor.

    Is this a bug or am I missing something?

    And the tap events in the menu page don't work as expected. I have to tap slightly above the text labels (~30px), otherwise, the tap events are not fired.

    image
    image

  • MarkoLudolphMarkoLudolph DEMember ✭✭

    Well, and the color of the "Secondary Commands" is also wrong.

    image

    3.png 290.3K
  • Shane000Shane000 USMember ✭✭✭

    i'm trying to use the nameof() operator in xamarin studio in my pcl forms project. but it's not resolving. Do I need to do something special?

  • JoeMankeJoeManke USMember ✭✭✭

    @ShanePope Are you getting error CS0103: The name 'nameof' does not exist in the current context? I get that in design mode for every instance of nameof or something that comes from a using static, but it actually builds fine.

  • rmarinhormarinho PTMember, Insider, Beta Xamurai

    @MarkoLudolph thanks, that will be fixed in the stable release

  • Any chance this would make it in 2.1.0? https://bugzilla.xamarin.com/show_bug.cgi?id=37757
    This completly disturbs the user experience in our app on iOS.

  • MichaelRumplerMichaelRumpler ATMember ✭✭✭✭

    Although the Effects collection is available for Cells too, it doesn't seem to be applied. My OnAttached method is never called.
    I created bug #38739 for that.

  • JKayJKay USMember ✭✭✭
    edited February 2016

    Can we fix this bug: "Hiding Bindable Properties throws "Sequence contains more than one matching element"

    Before releasing this to stable. As this release will break anyones project who has already implemented their own DataTemplateSelector shown here: blog.novotny.org/2014/12/31/datatemplateselector-for-xamarin-forms/

  • MarkoLudolphMarkoLudolph DEMember ✭✭

    Thanks a lot @rmarinho. I have another question: How does the ListView Virtualization for Windows/UWP work? I have a project that works flawlessly on Android (a custom cell with uneven height), but it doesn't work on UWP as expected as it does not reuse the Cells.

    And one more thing: I have a NavigationPage and the root Page has a ListView with a lot of items (see the screenshots above). Now, if I push a new Page onto the Normal/Modal Navigation Stack, all the Controls on the Root Page "somehow" get detached (I don't know how it internally works). And therefore, when I try to navigate back (guess the Controls get "attached" back to the Page), it takes ages, before the Root page shows up again (severals seconds on a Lumia 550 here in Release mode). Is there a way to fix this problem? Otherwise, the UWP version looks really good.

  • GaborNemethGaborNemeth HUUniversity ✭✭

    When can we expect that using XAML in a Shared Project will build for UWP?
    It's been reported 2 months ago with a repro sample here.

  • AdamPAdamP AUUniversity ✭✭✭✭✭
    edited February 2016

    Not sure if others are experiencing this but installing -pre4 it always adds references to things like

    Xamarin.Forms.Core.Design
    Xamarin.Forms.Xaml.Design

    Which causes the Could not load file or assembly Microsoft.Windows.Design.Extensibility in both Windows and iOS projects.

    This has happened on 3 separate projects I upgraded to -pre4

    The simple fix is just deleting these references so its not a big deal but its going to trip up a lot of people if I am not the only one who is experiencing this.

  • MichaelRumplerMichaelRumpler ATMember ✭✭✭✭

    You're not the only one, @AdamP

  • On Android I have a MasterDetailPage (as MainPage) and hitting the backbutton on the rootpage terminates the app with an crash since using the 2.1.0 pre Version. Didn't occur on 2.0.1

    Java.Lang.IllegalStateExceptionActivity has been destroyed
    Raw
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0xd6325138 + 0x0002b> in <filename unknown>:0 
      at Android.Runtime.JNIEnv.CallIntMethod (IntPtr jobject, IntPtr jmethod) <0xd99ee500 + 0x00093> in <filename unknown>:0 
      at Android.Support.V4.App.FragmentTransactionInvoker.CommitAllowingStateLoss () <0xd6324790 + 0x0005f> in <filename unknown>:0 
      at Xamarin.Forms.Platform.Android.AppCompat.NavigationPageRenderer.Dispose (Boolean disposing) <0xd6323f90 + 0x00113> in <filename unknown>:0 
      at Java.Lang.Object.Dispose () <0xd930f5d8 + 0x00019> in <filename unknown>:0 
      at Xamarin.Forms.Platform.Android.MasterDetailContainer.DisposeChildRenderers () <0xd6323f20 + 0x0002a> in <filename unknown>:0 
      at Xamarin.Forms.Platform.Android.MasterDetailContainer.Dispose (Boolean disposing) <0xd6323ef0 + 0x00027> in <filename unknown>:0 
      at Java.Lang.Object.Dispose () <0xd930f5d8 + 0x00019> in <filename unknown>:0 
      at Xamarin.Forms.Platform.Android.AppCompat.MasterDetailPageRenderer.Dispose (Boolean disposing) <0xd6323a80 + 0x0005b> in <filename unknown>:0 
      at Java.Lang.Object.Dispose () <0xd930f5d8 + 0x00019> in <filename unknown>:0 
      at Xamarin.Forms.Platform.Android.AppCompat.Platform.SetPage (Xamarin.Forms.Page newRoot) <0xd89d72b8 + 0x000bc> in <filename unknown>:0 
      at Xamarin.Forms.Platform.Android.AppCompat.Platform.Dispose () <0xd6322f48 + 0x0002b> in <filename unknown>:0 
      at Xamarin.Forms.Platform.Android.FormsAppCompatActivity.OnDestroy () <0xd633fc00 + 0x00067> in <filename unknown>:0 
      at Android.App.Activity.n_OnDestroy (IntPtr jnienv, IntPtr native__this) <0xd633fbc8 + 0x00032> in <filename unknown>:0 
      at (wrapper dynamic-method) System.Object:fc1c9e40-7a03-4be5-9c81-ef84609cfa78 (intptr,intptr)
      --- End of managed exception stack trace ---
    java.lang.IllegalStateException: Activity has been destroyed
        at android.support.v4.app.FragmentManagerImpl.enqueueAction(FragmentManager.java:1470)
        at android.support.v4.app.BackStackRecord.commitInternal(BackStackRecord.java:634)
        at android.support.v4.app.BackStackRecord.commitAllowingStateLoss(BackStackRecord.java:617)
        at md5b60ffeb829f638581ab2bb9b1a7f4f3f.FormsAppCompatActivity.n_onDestroy(Native Method)
        at md5b60ffeb829f638581ab2bb9b1a7f4f3f.FormsAppCompatActivity.onDestroy(FormsAppCompatActivity.java:70)
        at android.app.Activity.performDestroy(Activity.java:6407)
        at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1142)
        at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3818)
        at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3849)
        at android.app.ActivityThread.-wrap5(ActivityThread.java)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1398)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:148)
        at android.app.ActivityThread.main(ActivityThread.java:5417)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
    
  • BryanHunterXamBryanHunterXam USXamarin Team Xamurai

    @BastiBrauning Thanks for posting this. We are looking into it now.

  • TheRealJasonSmithTheRealJasonSmith USXamarin Team Xamurai

    This has been resolved in the 2.1.0 branch and will be in the final version

  • BastiBrauningBastiBrauning USMember
    edited February 2016

    Great, looking forward to 2.1.0!

    Since 2.1.0-pre version I also experience a strange crash on android when navigating to a page with a ListView where I have a HeaderTemplate which uses custom renderer. I'm unable to find the cause, anyone has an idea what can cause this exception?

    java.lang.reflectUnable to create layer for MyCustomLabelRenderer
    Raw

      --- End of managed exception stack trace ---
    java.lang.IllegalStateException: Unable to create layer for MyCustomLabelRenderer
        at android.os.MessageQueue.nativePollOnce(Native Method)
        at android.os.MessageQueue.next(MessageQueue.java:323)
        at android.os.Looper.loop(Looper.java:135)
        at android.app.ActivityThread.main(ActivityThread.java:5417)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
    

    Side note: I noticed this crash happens when using xaml, when I rewrite my view to C# code it stops happening.

  • MarkoLudolphMarkoLudolph DEMember ✭✭

    I would like to talk about Navigation on UWP. After looking at the code with ILSpy, the native root Control seems to be a Canvas. So, when you set the main Page in XF, the UWP Renderer creates the native container with the Controls from the page and adds the container to the Canvas. Now, when I e.g. push a modal page, the previous container added to the Canvas is removed and the new container is added to the Canvas.

    When you now pop the modal page, the current page is removed and the previous page is added to the Canvas again. And this is imho a problem: It's a huge perfomance hit. There seem to be a lot of calculations in the background to get the page back into the visibility tree. Well, you maybe don't notice it, when you have a fancy and simple demo pages with a button or two and run it in the simulator. But the performace hit is there.

    As I posted before, I have a huge ListView on the root page. If I push a modal page on it and navigate back, it takes up to five seconds on my Lumia 550, after I pressed the back button, before the page with the ListView is visible again. During that time, the page hangs. It seems, that it needs to scroll to the previous position again and therefore has to re-create all the Cells from the top again.

    So, my question is: Why do you remove the current container for a page from the Canvas, instead of, e.g. simply hiding it? In this case, when I navigate back, the current page would be removed and the previous page made only visible again.

    The same problem arises with the NavigatoinPageRenderer, where the root is a ContentControl. This should also be a Canvas, which should show/hide the native containers.

  • MarkoLudolphMarkoLudolph DEMember ✭✭

    The color of the secondary menu is still wrong in pre5 in UWP (when you press the three little dots). The MasterDetailPage Colors are working now, thanks.
    image

    4.png 152.9K
  • JensDemeyJensDemey USMember ✭✭

    Wondering if this will make it in the next release.
    https://bugzilla.xamarin.com/show_bug.cgi?id=38456

  • AlbertoPuyanaAlbertoPuyana COMember ✭✭

    [WinRT] Reduce instances of LayoutCycle detected, this issue is now worst than ever in my App, now it happens when I resize the windows, and in some pages, the reize of the windows does not update the size of the controls.

    I am using Xamarin.Forms Pre-5

  • Can we please also get this bug fixed?
    https://bugzilla.xamarin.com/show_bug.cgi?id=37625

Sign In or Register to comment.