We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Images for Carousel in Android only do not Render

I've got a Xamarin Forms app.  Shared code in XAML.  It's works in iOS just fine, but Android doesn't show anything just a spot where the Carousel should be.  I've simplified down everything as much as I can, including just putting a static file name under the Source attribute.

It's not any problem with where or how images are stored in the Android project, other images show up fine, just not in the carousel.  I'm using version 15.3.0.29.  Other libraries are current.  I have no idea how to debug this beyond what I've done.. no way to turn on a trace to see if the run-time in Android doesn't like something, or if the plugin is rendering something wrong.



Code snips:

         <ContentPage.Resources>
            <ResourceDictionary>
                <DataTemplate x:Key="itemTemplate">
                    <Image Source="abc123.jpg" Aspect="AspectFill">
                          <Image.GestureRecognizers>
                            <TapGestureRecognizer
                                    Tapped="OnImageNameTapped"
                                    NumberOfTapsRequired="1" />
                          </Image.GestureRecognizers>
                    </Image>
                        
                </DataTemplate>
            </ResourceDictionary>
         </ContentPage.Resources>
    
         <syncfusion:SfCarousel x:Name="carousel" ItemTemplate="{StaticResource itemTemplate}" 
            Offset="30" RotationAngle="45"
            ItemWidth="130" ItemHeight="180"
            HeightRequest="180" WidthRequest="130"
            ItemsSource="{Binding ImageCollection}"  
            SelectionChanged="carousel_SelectionChanged">
        </syncfusion:SfCarousel>
  



5 Replies

RB Rabhia Beham Kathar Mideenar Syncfusion Team September 18, 2017 07:12 AM UTC

Hi Jeff Lundgren,

Thanks for contacting Syncfusion Support.

Query: Need to display Images for carousel in Android.

We have checked the reported issue with version 15.3.0.29 and were able to reproduce the same. It can be resolved by using DataSource Property in SfCarousel.Please find the sample from the below link,

Sample Link: http://www.syncfusion.com/downloads/support/forum/132677/ze/CarouselTester1-1913762210 

And the reported issue fix will be available in our upcoming Vol 3 SP2 release, which will be rolled out by the end of september, 2017.

Regards,
Rabhia Beham K.


 



JL J Lundgren September 18, 2017 08:59 PM UTC

Thank you, that works.

The documentation at https://help.syncfusion.com/xamarin/sflistview/getting-started should be updated to reflect the requirement for Android, that iOS doesn't seem to have.



ET Eswaran Thirugnanasambandam Syncfusion Team September 19, 2017 10:29 AM UTC

Hi Jeff Lundgren,

Thanks for your update,

We are glad that you have achieved your requirement. we will modify the change in UG and the changes will be included in our Volume 3 Service pack 2 which is expected to be rolled out by the end of September 2017.

Regards,
Eswaran AT.


DA David Allen November 11, 2017 03:25 AM UTC

The sample you provide does not work. No images are rendered. Try downloading the sample and building it form scratch then running on an Android device or emulator. You get a blank screen because the DataSource Binding is not pulling in the source collection correctly. The Binding context and the Data source properties are being set correctly and it works correctly on iOS, so the bug must be in your SFCarousel Renderer for Android. If the data source is set to a local collection in the code behind, rather then bound using data binding, then it renders correctly.

This bug makes this control completely unsuitable for any project using MVVM. As Xamarin.Forms is designed to use MVVM, it is useless for use with Xamarin.Forms.

In addition, much of your basic documentation and NuGet information is incorrect. For example, the latest version of the control 15.3.033 states that it has a dependency on Xamarin.Forms >= 2.3.3.180. Whilst this may the the case in terms of build compatibility, running it with XF 2.3.3.180 on Android causes a crash when it tries to render.

The very basic nature of this bug, and the lack of clarity on compatible versions, suggests poor quality control and lack of testing. I cant therefore recommend using your product in production for client projects.




ET Eswaran Thirugnanasambandam Syncfusion Team November 13, 2017 09:47 AM UTC

Hi David Allen,

Thanks for your update.

We are unable to reproduce the reported issue “Running SfCarousel with XF 2.3.3.180 on Android causes a crash” from our side. Our SfCarousel control completely supports the MVVM Pattern. We have prepared a sample using the MVVM Pattern and we have also prepared a video demonstrating the carousel control. Please find the sample and video from the below link.

Sample Link: http://www.syncfusion.com/downloads/support/forum/132677/ze/CarouselTester11733123456  

If you still face issues with SfCarousel in MVVM, please revert us with issue reproducing sample. This will help us to provide appropriate solution on this.

Regards,
Eswaran AT  


Loader.
Live Chat Icon For mobile
Up arrow icon