Xamarin.Forms 2.3.0-hotfix1

BryanHunterXamBryanHunterXam USXamarin Team Xamurai
edited November 2016 in Xamarin.Forms Releases

2.3.0-hf1

Bug Fixes:

  • 41980 - "TabBar BarTintColor no longer working in 2.3.0.49"
  • 42032 - "UINavigationBar.Appearance.BarTintColor changes Tab bar color"

Other fixes:

  • Fixed build issues in Cycle6

2.3.0-stable

Bug fixes

36447 - PinchGestureRecognizer Only Works on Android API Level 19+

Other fixes

Fixed build issues

2.3.0-pre3

News

In parallel to this "-pre3" release, Xamarin.Forms.CarouselView 2.3.0-pre1 was also shipped. As the CarouselView's version suggests, it has a dependency on Xamarin.Forms 2.3.0 ("-pre3" or greater).

Bug fixes

40830 - AppLinkEntry.KeyValues collection is always empty
40844 - [Android] Forms Android app gets stuck with GC bridge calls when using current beta branch of Xamarin.Android/Mono Runtime
40866 -[Android] RegisterLink throws an ArgumentException on Android

Other changes

Internals visible for CarouselView

2.3.0-pre2

News

Pages

Adding AzureDataSource support by introducing Xamarin.Forms.Pages.Azure nuget.

2.3.0-pre1

New Features

Data Pages

Xamarin.Forms DataPages are available as a preview for customers to try and provide feedback. The preview is available in the Xamarin.Forms.Pages nuget package. DataPages provide an API to quickly and easily bind a data source to pre-built views that can be styled with Themes.

Themes

Xamarin.Forms Themes are available as a preview for customers to try and provide feedback. A theme is added to a Xamarin.Forms application by including the Xamarin.Forms.Theme.Base Nuget package, plus either an additional package that defines a specific theme (eg. Xamarin.Forms.Theme.Light) or a locally defined theme.

URL Navigation

Deep link directly to any page within your Xamarin.Forms app with URL Navigation.

In order to avoid adding a dependency on GooglePlayServices to the Xamarin.Forms core package, we've created a new Xamarin.Forms.AppLinks nuget package that will be required for this feature to work on the Android platform.

Embedded Native Controls

Embed custom Xamarin.iOS and Xamarin.Android controls in Xamarin.Forms applications.

Other New Features

  • Multiple shared resource dictionaries with implicit styles and/or dynamic resources are now supported
  • Can now set the background and text color of the Tab bar on TabbedPage.
  • Known Issues:

    • [WinRT, WinPhone 8.1, UWP] Setting BarTextColor does not currently work.
    • [WinPhone 8.1, UWP] If the TabbedPage contains a NavigationPage, the BarBackgroundColor and BarTextColor for the NavigationPage takes precedence
    • [WinPhone 8.1] If the TabbedPage contains a NavigationPage, switching between tabs may cause the background color to be lost.
    • [Android] Cannot set BarTextColor back to default after changing it to a non-default color.
  • Can now set TextColor on Picker, TimePicker, DatePicker.

Bugs Fixed

  • 23942 - Cannot bind properties in BindableObjects added to static resources in XAML
  • 33135 - Apps built for Windows 8.1 using XF, fail on Windows 10 release, with System.NotImplementedException
  • 35529 - WebView.Eval throwing a NotImplementedException on WP8.1 (WinRT) (XF 1.5.1.6471)
  • 36374 - Xamarin.Forms.Platform.UWP.TabbedPageRenderer.OnElementChanged is not virtual
  • 36955 - [iOS] ViewCellRenderer.UpdateIsEnabled Object reference not set to an instance of an object
  • 39636 - Cannot use XamlC with OnPlatform in resources, it throws System.InvalidCastException
  • 39847 - Using MasterDetailPage class as a ExportRenderer does not load in Android
  • 39963 - iOS WebView has wrong scrolling size when loading local html content with images
  • 40096 - Invalid Cast Exception when setting SearchBar Command
  • 40185 - [UWP] ContentPage does not have proper right bounds in landscape

Other Fixes

  • [Android] Fixed issue where accessing Device.IsInvokeRequired on Android resulted in a race condition and possible crash.
  • [Android] Fixed potential crash when styling application
  • [iOS] Fixed issue with WebView dispose and resizing

Important notes

«1

Posts

  • AdrianKnightAdrianKnight USMember ✭✭✭✭

    Is CarouselView out on GitHub as well? Also, it would be great to see documentation on how to use it.

  • AdrianKnightAdrianKnight USMember ✭✭✭✭
    edited May 2016

    I'm trying to create a CarouselView with each of its items being a ListView. Not sure if this is intended use case.

            public App()
            {
                var content = new ContentPage {Title = "Content"};
    
                var list = new List<Test>();
    
                for (var i = 0; i < 5; i++)
                {
                    var test = new Test();
    
                    var random = new Random();
                    test.Color = Color.FromRgb(random.Next(0, 256), random.Next(0, 256), random.Next(0, 256));
    
                    var l = new List<string>();
                    for (var j = 0; j < 100; j++)
                    {
                        l.Add(j + ", " + Guid.NewGuid().ToString());
                    }
                    test.Source = l;
    
                    list.Add(test);
                }
    
                var carouselView = new CarouselView
                {
                    ItemTemplate = new DataTemplate(() =>
                    {
                        var listView = new ListView();
                        listView.SetBinding(ListView.BackgroundColorProperty, "Color");
                        listView.SetBinding(ListView.ItemsSourceProperty, "Source");
                        return listView;
                    }),
                    ItemsSource = list
                };
                content.Content = carouselView;
    
                MainPage = new NavigationPage(content);
            }
    
            private class Test
            {
                public Color Color;
                public List<string> Source;
            }
    

    When I run the app on Android (haven't tested it on iOS), I get nothing but a white screen for the carousel view.

    If I swipe right and left several times and scroll up and down like a child, I eventually get the following:

    System.InvalidOperationException: Sequence contains more than one element
    
    05-28 17:59:47.791 D/Mono    (32482): DllImport attempting to load: '/system/lib/liblog.so'.
    05-28 17:59:47.791 D/Mono    (32482): DllImport loaded library '/system/lib/liblog.so'.
    05-28 17:59:47.791 D/Mono    (32482): DllImport searching in: '/system/lib/liblog.so' ('/system/lib/liblog.so').
    05-28 17:59:47.801 D/Mono    (32482): Searching for '__android_log_print'.
    05-28 17:59:47.801 D/Mono    (32482): Probing '__android_log_print'.
    05-28 17:59:47.801 D/Mono    (32482): Found as '__android_log_print'.
    05-28 17:59:47.811 I/MonoDroid(32482): UNHANDLED EXCEPTION:
    05-28 17:59:47.811 I/MonoDroid(32482): System.InvalidOperationException: Sequence contains more than one element
    05-28 17:59:47.811 I/MonoDroid(32482):   at System.Linq.Enumerable.Single[TSource] (IEnumerable`1 source) [0x0008e] in /Users/builder/data/lanes/1196/3e934261/source/mono/external/referencesource/System.Core/System/Linq/Enumerable.cs:1050 
    05-28 17:59:47.811 I/MonoDroid(32482):   at Xamarin.Forms.Platform.CarouselViewRenderer.<Initialize>b__8_2 () [0x00011] in <filename unknown>:0 
    05-28 17:59:47.811 I/MonoDroid(32482):   at Xamarin.Forms.Platform.CarouselViewRenderer+OnScrollListener.OnScrollStateChanged (Android.Support.V7.Widget.RecyclerView recyclerView, Int32 newState) [0x0003d] in <filename unknown>:0 
    05-28 17:59:47.811 I/MonoDroid(32482):   at Android.Support.V7.Widget.RecyclerView+OnScrollListener.n_OnScrollStateChanged_Landroid_support_v7_widget_RecyclerView_I (IntPtr jnienv, IntPtr native__this, IntPtr native_recyclerView, Int32 newState) [0x00011] in <filename unknown>:0 
    05-28 17:59:47.811 I/MonoDroid(32482):   at (wrapper dynamic-method) System.Object:8415a928-a62f-4ad8-ac4f-727ee1103917 (intptr,intptr,intptr,int)
    05-28 17:59:47.841 W/art     (32482): JNI RegisterNativeMethods: attempt to register 0 native methods for android.runtime.JavaProxyThrowable
    05-28 17:59:47.851 D/Mono    (32482): DllImport searching in: '__Internal' ('(null)').
    05-28 17:59:47.851 D/Mono    (32482): Searching for 'java_interop_jnienv_throw'.
    05-28 17:59:47.851 D/Mono    (32482): Probing 'java_interop_jnienv_throw'.
    05-28 17:59:47.851 D/Mono    (32482): Found as 'java_interop_jnienv_throw'.
    Unhandled Exception:
    
    System.InvalidOperationException: Sequence contains more than one element
    
    05-28 17:59:49.111 I/MonoDroid(32482): UNHANDLED EXCEPTION:
    05-28 17:59:49.111 I/MonoDroid(32482): System.InvalidOperationException: Sequence contains more than one element
    05-28 17:59:49.111 I/MonoDroid(32482):   at (wrapper dynamic-method) System.Object:8415a928-a62f-4ad8-ac4f-727ee1103917 (intptr,intptr,intptr,int)
    05-28 17:59:49.111 I/MonoDroid(32482):   at (wrapper native-to-managed) System.Object:8415a928-a62f-4ad8-ac4f-727ee1103917 (intptr,intptr,intptr,int)
    05-28 17:59:49.111 I/MonoDroid(32482):   at (wrapper managed-to-native) Java.Interop.NativeMethods:java_interop_jnienv_call_nonvirtual_boolean_method_a (intptr,intptr&,intptr,intptr,intptr,Java.Interop.JniArgumentValue*)
    05-28 17:59:49.111 I/MonoDroid(32482):   at Java.Interop.JniEnvironment+InstanceMethods.CallNonvirtualBooleanMethod (JniObjectReference instance, JniObjectReference type, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x0008f] in /Users/builder/data/lanes/3204/804c6cb7/source/Java.Interop/src/Java.Interop/Java.Interop/JniEnvironment.g.cs:11728 
    05-28 17:59:49.111 I/MonoDroid(32482):   at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualBooleanMethod (System.String encodedMember, IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x0006b] in /Users/builder/data/lanes/3204/804c6cb7/source/Java.Interop/src/Java.Interop/Java.Interop/JniPeerMembers.JniInstanceMethods_Invoke.cs:67 
    05-28 17:59:49.111 I/MonoDroid(32482):   at Android.Views.View.DispatchTouchEvent (Android.Views.MotionEvent e) [0x0002c] in /Users/builder/data/lanes/3204/804c6cb7/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Views.View.cs:12433 
    05-28 17:59:49.111 I/MonoDroid(32482):   at Xamarin.Forms.Platform.Android.PlatformRenderer.DispatchTouchEvent (Android.Views.MotionEvent e) [0x0004e] in C:\BuildAgent\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\PlatformRenderer.cs:35 
    05-28 17:59:49.111 I/MonoDroid(32482):   at Android.Views.View.n_DispatchTouchEvent_Landroid_view_MotionEvent_ (IntPtr jnienv, IntPtr native__this, IntPtr native_e) [0x00011] in /Users/builder/data/lanes/3204/804c6cb7/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Views.View.cs:12420 
    05-28 17:59:49.111 I/MonoDroid(32482):   at (wrapper dynamic-method) System.Object:5ef7842a-cc11-4bad-aac8-bb8825a00793 (intptr,intptr,intptr)
    
  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭
    edited June 2016

    This works for me (tested with first version of carousel view). Ask if it's not clear

    using System;
    using Xamarin.Forms;
    using System.Collections.ObjectModel;
    using SimpleCustomGesureFrame;
    
    namespace TestBth
    {
        public class PageCarousel : ContentPage
        {
    
            public PageCarousel (ObservableCollection<string> lista)
            {
                NavigationPage.SetTitleIcon (this, "icon.png");
                NavigationPage.SetHasNavigationBar (this, true);
                NavigationPage.SetHasBackButton (this, true);
    //          NavigationPage.SetBackButtonTitle (this, "CAROUSEL");
                Title = "RIBALTE";
                StackLayout sl = new StackLayout ();
    
                CarouselView cv = new CarouselView ();
                cv.ItemsSource = lista;
                cv.ItemTemplate = new DataTemplate (typeof(BarcodeTemplate));
                sl.Children.Add (cv);
    
                Content = sl;
    
            }
    
            public class BarcodeTemplate : ContentView {
    
                public BarcodeTemplate(){
    //              GestureFrame gf = new GestureFrame
    //              {
    //                  HorizontalOptions = LayoutOptions.FillAndExpand,
    //                  VerticalOptions = LayoutOptions.FillAndExpand,
    //                  BackgroundColor = Color.FromHex("bf3122"),
    //              };
    //
    //              gf.SwipeTop += async (sender, e) => 
    //              {
    //                  await App.MyNavPage.PopAsync ();
    //              };
                    TapGestureRecognizer tgr = new TapGestureRecognizer();
                    tgr.NumberOfTapsRequired = 2;
                    tgr.Tapped += async (object sender, EventArgs e) => {
                        await App.MyNavPage.PopAsync ();
                    };
    
                    GestureRecognizers.Add (tgr);
                    Label l = new Label();
                    l.FontSize = 40;
                    l.SetBinding (Label.TextProperty,".");
    //              gf.Content = l;
                    Content = l;
    
                }
            }
        }
    }
    
  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭

    Sorry for the bad format

  • ThomasGoerlichThomasGoerlich DEMember ✭✭

    I tried to use the CarouselView in a Xaml layout and got the following error message:
    Xamarin.Forms.Xaml.XamlParseException: Position 20:10. Type CarouselView not found in xmlns http://xamarin.com/schemas/2014/forms

    Am i missing an additional namespace or ist the forms one not up to date with this CarouselView?

  • tomnuentomnuen VNMember ✭✭

    Got this after update:

    Foundation.MonoTouchException: Objective-C exception thrown. Name: NSInternalInconsistencyException Reason: Application windows are expected to have a root view controller at the end of application launch.

  • rmarinhormarinho PTMember, Insider, Beta Xamurai

    @ThomasGoerlich can i see your xaml?

    Are you defining xmlns alias for the new dll?

  • DanielBarrrosAmorimDanielBarrrosAmorim BRUniversity ✭✭

    @rmarinho How do you reference the Xamarin.Forms.CarouselView on the XAML project ?Do you have an example project?

  • AndyBarajasAndyBarajas USMember ✭✭

    I found two things I consider bugs with CarouselView.

    1) Let's say we have two items in the carousel view and we are on the second view. On iOS, if we rotate the device the carousel view will show the first item. For Android, its consistent and stays on the second item.

    2) Sometimes on Android, I get a "Sequence contains more than one element" which switching between two views that have list views inside them. In the example project attached, give a scrolling and swiping motion at the same time(might take a few tries).

  • SanderSchuttenSanderSchutten USUniversity ✭✭

    @DanielBarrrosAmorim:
    First, add this namespace to your page:
    xmlns:cv="clr-namespace:Xamarin.Forms;assembly=Xamarin.Forms.CarouselView"

    Then you can reference the CarouselView like this:
    <cv:CarouselView ItemsSource="{Binding Images}"> <cv:CarouselView.ItemTemplate> <DataTemplate> <StackLayout> <Image Source="{Binding}" /> </StackLayout> </DataTemplate> </cv:CarouselView.ItemTemplate> </cv:CarouselView>

  • JKayJKay USMember ✭✭✭

    Carousel View Nuget Mentions the following issue:

    Known issues:

    Need to add on your Windows projects (UWP and WINRT) to your App.xaml resources the following lines:

    <DataTemplate x:Key="ItemTemplate"> 
                <uwp:ItemControl HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" /> 
    </DataTemplate>
    

    But what is the uwp namespace?

  • ThomasGoerlichThomasGoerlich DEMember ✭✭

    @rmarinho Thanks! I did not define a xmlns for the dll. That was my mistake :)

    I wanted to use the CarouselView with ListViews as well and ran into the same problem as @AndyBarajas with an "System.InvalidOperationException: Sequence contains more than one element" error while scrolling in multiple directions.

  • JKayJKay USMember ✭✭✭

    @BryanHunterXam Do the Xamarin.Forms team have a roadmap of things they are currently working on / looking to implement.

    I often find myself in the situation where I am not sure whether to write my own implementation of things or wait for Xamarin to implement it.

    In my situation I am looking at using SVG images. For two reasons:
    1. Reduce application sizes
    2. Easier to maintain and create Icons.
    3. Change theme / Colour of Icons at runtime

    But I am completely in the dark about what Xamarins plans are surrounding SVG images. There are two third party controls out there but they are not perfect.

    I imagine a lot of other developers find themselves in similar situations

  • ThomasGoerlichThomasGoerlich DEMember ✭✭

    @JKay there is this proposals thing on their github repo https://github.com/xamarin/xamarin-evolution/tree/master/xamarin.forms but that doesn't seem to be used all that much (yet?).
    There is also a mailinglist (http://lists.xamarin.com/mailman/listinfo/forms-devel) with a few bits of information (e.g. a thread about tvOS support).
    But a real roadmap would be great :)

  • DH_HA1DH_HA1 USMember ✭✭✭

    .Single() in LINQ is dangerous b/c it will always throw an exception if there is more than one.

    .SingleOrDefault() is better and then check for null

  • JKayJKay USMember ✭✭✭
    edited June 2016

    Does anyone know how to use the MergedWith property on a ResourceDictionary? I have the following:

    <ResourceDictionary xmlns="http://xamarin.com/schemas/2014/forms"
                 xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                 xmlns:styling="clr-namespace:MyApp.Styling;assembly=MyApp.Forms"
                 x:Class="MyApp.Styling.Styles" MergedWith="{styling:PastelTheme2}">
      <Color x:Key="LighterSlate">#988088</Color>
    </ResourceDictionary>
    

    Where PastelTheme2 is another ResourceDictionary But this doesn't seem to work. Has anyone got any suggestions?

  • AdrianKnightAdrianKnight USMember ✭✭✭✭
    edited June 2016

    When you create a carousel of listviews, listview scrolling seems messed up. Any slight right/left swipe will cancel listview scroll. I think there should be a way to set swipe tolerance so carouselview does not wake up.

    Also, if you stop swiping the carousel between two positions, it will crash the app.

    Finally, the carousel doesn't seem to snap back into the original position if you don't swipe long enough.

  • DirkWilhelmDirkWilhelm USMember ✭✭✭

    XamlCompilation on UWP seems to break some layout options.

    For example:

    • Toolbaritem Icons are dissapearing
    • background colors of frames dissappear
    • width and height of frames are not correct
  • seanydaseanyda GBMember ✭✭✭✭✭

    I had a weird issue yesterday... I was using the Carousel view pre-release and put my build on test flight and the carousel view pages were broken... so i had to downgrade back to the pre-release with it :(

  • rmarinhormarinho PTMember, Insider, Beta Xamurai

    @DirkWilhelm does it happen only in UWP? Can you give us a reproduction?

    Thanks

  • LesterMeeksLesterMeeks USMember ✭✭

    Do we have a good spot to discuss carousel issues? I have updated to 2.3.0 pre1 and have a slide that has a entry on it for typing your username. On iOS it works good, on android when the soft keyboard is shown the carousel seems to jump back to slide 0 immediately. Anyone tried something similar?

  • RaphaelSchindlerRaphaelSchindler USMember ✭✭✭
    edited June 2016

    @AndyBarajas @ThomasGoerlich I'm encountering the same issue with Sequence contains more than one element. Out of couriosity I added 100 ContentViews to a CarouselView and when I switched from page 52 to page 53 the error occured. It's completly reproducable. Also swiping the pages slowly causes this error to appear after some time. @rmarinho do guys already have an idea about this problem?

    //Edit: Only happened on Android. iOS seems fine. UWP I don't know because I have no idea where I have to put DataTemplate thingy in

  • jim_seowjim_seow DEMember ✭✭
    edited June 2016

    @rmarinho and @DavidBritch

    Can someone please kindly share a working UWP simple carouselView 2.3.0-pre1 sample

    So we know if we have issues, we could consider that these issues could be new and we could report back.

    => Right now, the moment I add the CarouselView to the UWP project references, I immediately get an error when compile.

    instruction
    Known issues:

    Need to add on your Windows projects (UWP and WINRT) to your App.xaml resources the following lines:

    <DataTemplate x:Key="ItemTemplate"> 
                <uwp:ItemControl HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" /> 
    </DataTemplate>
    
        <Application ... xmlns:theme="clr-namespace:Xamarin.Forms.Themes;assembly=Xamarin.Forms.Theme.Light">
            <Application.Resources>
                <ResourceDictionary MergedWith="theme:LightThemeResources">
                    <Color x:Key="PageBackgroundColor">Yellow</Color>
                    <Color x:Key="HeadingTextColor">Black</Color>
                    <Color x:Key="NormalTextColor">Blue</Color>
                    ...
                </ResourceDictionary>
            </Application.Resources>
        </Application>
    
  • AntoninMARTIN.9121AntoninMARTIN.9121 FRUniversity
    edited June 2016

    Hello,

    Is anybody tried to use Commands with binding in a CarouselView ? I've just tried to use a simple Command on a Button but it didn't work.

    <cv:CarouselView VerticalOptions="FillAndExpand" x:Name="carous" Grid.Row="1" ItemsSource="{Binding Items}"> <cv:CarouselView.ItemTemplate> <DataTemplate> <StackLayout> <Button Command="{Binding TestCommand}" HorizontalOptions="Center" BorderColor="Transparent" Text="Test" BackgroundColor="White" TextColor="Black" FontSize="18" /> </StackLayout> </DataTemplate> </cv:CarouselView.ItemTemplate> </cv:CarouselView>

    And in my ViewModel :

    TestCommand = new RelayCommand(() => { DependencyService.Get<IDeviceService>().TestSettings(); });

    Thanks :smile:

  • AntoninMARTIN.9121AntoninMARTIN.9121 FRUniversity

    Ok I've just extracted this Button from carouselView and manage its visibility thanks to Triggers :smile:

  • RyanWatsonRyanWatson USMember ✭✭✭

    @RaphaelSchindler said:
    @AndyBarajas @ThomasGoerlich I'm encountering the same issue with Sequence contains more than one element. Out of couriosity I added 100 ContentViews to a CarouselView and when I switched from page 52 to page 53 the error occured. It's completly reproducable. Also swiping the pages slowly causes this error to appear after some time. @rmarinho do guys already have an idea about this problem?

    //Edit: Only happened on Android. iOS seems fine. UWP I don't know because I have no idea where I have to put DataTemplate thingy in

    @RaphaelSchindler I've gotten this issue as well on Android a couple of times. Normally happens for me if you are swiping slowly. Ever find an answer for this?

  • RasmusBjergRasmusBjerg DKMember ✭✭

    Ive also got the same issue as @RyanWatson describes.

    Besides that, i cannot set the Position in the CarouselView, when the CarouselView is initialized, first after the CarouselView is initialize, i am able to set the Position. I have tried to set the position with a binding, and also hardcode it, but nothing works. The CarouselView Position property worked fine, before it was seperated from the Xamarin.Forms nuget.

  • AdrianKnightAdrianKnight USMember ✭✭✭✭

    @BryanHunterXam Why hasn't CarouselView been open-sourced yet? Would be great to see a repository we could take a look at and contribute to.

  • ThomasGoerlichThomasGoerlich DEMember ✭✭

    @RyanWatson said:

    @RaphaelSchindler said:
    @AndyBarajas @ThomasGoerlich I'm encountering the same issue with Sequence contains more than one element. Out of couriosity I added 100 ContentViews to a CarouselView and when I switched from page 52 to page 53 the error occured. It's completly reproducable. Also swiping the pages slowly causes this error to appear after some time. @rmarinho do guys already have an idea about this problem?

    //Edit: Only happened on Android. iOS seems fine. UWP I don't know because I have no idea where I have to put DataTemplate thingy in

    @RaphaelSchindler I've gotten this issue as well on Android a couple of times. Normally happens for me if you are swiping slowly. Ever find an answer for this?

    my current "solution" is to not use the carouselview and wait for a fix from xamarin or a hint on what i might be doing wrong. we pretty much just started with a new app so there are enough other things to work on and wait a bit for xamarin to release an update or sourcecode or something :smile:

  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭

    this evening I am using new CarouselView 2.3.0-pre1 and I have, during switching from one view to another, an exception

    Sequence contains more than one element

    this is the stack

    at System.Linq.Enumerable.Single[TSource] (IEnumerable`1 source) [0x0008e] in /Users/builder/data/lanes/3236/ee215fc9/source/mono/external/referencesource/System.Core/System/Linq/Enumerable.cs:1050
    at Xamarin.Forms.Platform.CarouselViewRenderer.b__8_2 () [0x00011] in :0
    at Xamarin.Forms.Platform.CarouselViewRenderer+OnScrollListener.OnScrollStateChanged (Android.Support.V7.Widget.RecyclerView recyclerView, Int32 newState) [0x0003d] in :0
    at Android.Support.V7.Widget.RecyclerView+OnScrollListener.n_OnScrollStateChanged_Landroid_support_v7_widget_RecyclerView_I (IntPtr jnienv, IntPtr native__this, IntPtr native_recyclerView, Int32 newState) [0x00011] in :0
    at (wrapper dynamic-method) System.Object:8f7ae733-0624-4221-ae35-6cccbc37282a (intptr,intptr,intptr,int)

    @rmarinho it's a known bug?
    Thanks

  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭

    yes it's seems a known bug

  • 101chris101chris CAMember

    I am trying to use the CarouselView to display multiple sub-views. (hopefully this is a supported case)

    the only way i managed to get it to work was to set everything in code:

    <?xml version="1.0" encoding="utf-8" ?>
    <ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
                 xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                 xmlns:cv="clr-namespace:Xamarin.Forms;assembly=Xamarin.Forms.CarouselView"
                 xmlns:local="clr-namespace:CarouselViewDemo"
                 x:Class="CarouselViewDemo.MainPage">
    
      <Grid>
        <StackLayout Orientation="Vertical">
          <Label Text="Top" FontSize="40" />
          <cv:CarouselView x:Name="caro"></cv:CarouselView>
          <Label Text="Bottom" FontSize="40" />
        </StackLayout>
      </Grid>
    
    </ContentPage>
    

    and then configure the bindings to a ContentView item in code:

    namespace CarouselViewDemo {
    
      public class CaroView {
        public View View { get; set; }
      }
    
      public class CaroViews : ObservableCollection<CaroView> {
        public CaroViews() {
          //just create some stacklayout views for testing
          for (int i = 1; i < 4; i++) {
            var sp = new StackLayout { Orientation = StackOrientation.Vertical };
            sp.Children.Add(new Label { Text = $"view {i} stack 1" });
            sp.Children.Add(new Label { Text = $"view {i} stack 2" });
            sp.Children.Add(new Label { Text = $"view {i} stack 3" });
            Add(new CaroView { View = sp });
          }
        }
      }
    
    
      public partial class MainPage : ContentPage {
    
        CaroViews MyCaroViews = new CaroViews();
    
        public MainPage() {
          InitializeComponent();
    
          var binding1 = new Binding();
          binding1.Source = MyCaroViews;
    
          var viewDataTemplate = new DataTemplate(() => {
            var v = new ContentView();
            v.SetBinding(ContentView.ContentProperty, "View");
            return v;
          });
    
          caro.ItemTemplate = viewDataTemplate;
          caro.SetBinding(CarouselView.ItemsSourceProperty, binding1);
        }
      }
    }
    

    so this does work, though can anyone suggest a cleaner way?

    also, I invariably get the Sequence contains more than one element error, (especially if i "drum" quickly on the view with 2 fingers) so it seems pretty much unusable at this time.

  • MichaelRumplerMichaelRumpler ATMember ✭✭✭✭

    @BryanHunterXam You said this version fixes bug #40844 but I cannot access it.
    Is it similar to what I already wrote to bug #38982 and bug #38577? Could that also fix the bug I was running into?

  • 101chris101chris CAMember

    is it possible that the Sequence contains more than one element error is related to this bug?

    PanGestureRecognizer sometimes won't fire completed event when dragging very slowly

    I don't know about the inner workings of the CarouselView, but if it relies on PanGestureRecognizer, it might make sense, and both errors feel the same to me. (IE they feel like they happen when doing the same thing)

  • EmanueleSabettaEmanueleSabetta ITBeta ✭✭✭

    @JKay said:

    @BryanHunterXam
    In my situation I am looking at using SVG images.
    But I am completely in the dark about what Xamarins plans are surrounding SVG images. There are two third party controls out there but they are not perfect.

    I imagine a lot of other developers find themselves in similar situations

    I agree with you JKay. SVG is needed and Xamarin is late to the party. I'm in the same situation, like many others. UI development is now ten times quicker with Sketch+SVG or Inkscape+SVG or AdobeXD+SVG. This is the new paradigm for UI development. Only us with Xamarin are left behind with no SVG support. We need to know if and when Xamarin is going to add support for SVG assets, or we are going to migrate to a native framework. The advantage of using Xamarin is now increasingly outweighted by the disadvantages of not having SVG support. At least tell us that you have added SVG to the roadmap.

  • FrtySixAndTwoFrtySixAndTwo USMember ✭✭

    I am using Forms 2.3.0.46-pre3 and I am having an issue with setting Entry Keyboard="Numeric" on iOS. It does not popup the numeric only keyboard. I've tried eliminating other things and still same issue. Any ideas? Is this a bug in the pre?

  • jim_seowjim_seow DEMember ✭✭

    xamarin-forms-carouselview setup for Windows (by James Montemagno June 15, 2016)/

    <Application x:Class="MyApp.UWP.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:uwp="using:Xamarin.Forms.Platform" xmlns:local="using:MyApp.UWP" RequestedTheme="Light"> <Application.Resources> <DataTemplate x:Key="ItemTemplate"> <uwp:ItemControl HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" /> </DataTemplate> </Application.Resources> </Application>

  • rmarinhormarinho PTMember, Insider, Beta Xamurai

    Please use this thread https://forums.xamarin.com/discussion/69120/carouselview-2-3-0-pre1 for CarouselView feedback and issues.

  • RaymondKellyRaymondKelly USMember ✭✭✭

    Still no fixes to make ListView usable on iOS :(

«1
Sign In or Register to comment.