custom template selector shows no data in IOS

7 posts, 1 answers
  1. YUANTAO
    YUANTAO avatar
    6 posts
    Member since:
    Sep 2010

    Posted 07 Feb 2018 Link to this post

    When I add or remove an list item, The Image control in the Template do not show(when add several items, the first Picture show a blank however others works).

    When I remove an item, the most item will works bad, the Image in the item will don't show however the listview's itemResource has the correct data.

    There is not any mistake in Android, It works well.

    Here are my xaml:

    <!--<telerikDataControls:RadListView.ItemTemplateSelector>
                    <local:Entities.CustomItemTemplateSelector>
                        <local:Entities.CustomItemTemplateSelector.Template1>
                            <DataTemplate>
                                <telerikListView:ListViewTemplateCell Tapped="ListCellTapped" >
                                    <telerikListView:ListViewTemplateCell.View>
                                        <StackLayout Orientation="Horizontal" BackgroundColor="White" >
                                            <Image Margin="10" Aspect="AspectFit" Source="{Binding ImgSource}"/>
                                        </StackLayout>
                                    </telerikListView:ListViewTemplateCell.View>
                                </telerikListView:ListViewTemplateCell>
                            </DataTemplate>
                        </local:Entities.CustomItemTemplateSelector.Template1>
                        <local:Entities.CustomItemTemplateSelector.Template2>
                            <DataTemplate>
                                <telerikListView:ListViewTemplateCell Tapped="ListCellTapped" >
                                    <telerikListView:ListViewTemplateCell.View>
                                        <StackLayout Orientation="Horizontal" BackgroundColor="White">
                                            <telerikInput:RadButton BackgroundImage="add.png" WidthRequest="100" HeightRequest="100" BorderRadius="50" Clicked="AddPicBtn_Clicked"/>
                                        </StackLayout>
                                    </telerikListView:ListViewTemplateCell.View>
                                </telerikListView:ListViewTemplateCell>
                            </DataTemplate>
                        </local:Entities.CustomItemTemplateSelector.Template2>
                    </local:Entities.CustomItemTemplateSelector>
                </telerikDataControls:RadListView.ItemTemplateSelector>-->

     

    It works well if I don't use the template selector.

  2. Answer
    Nikolay
    Admin
    Nikolay avatar
    37 posts

    Posted 09 Feb 2018 Link to this post

    Hello Yuantao,

    I can confirm that this is an issue in our ListView control for iOS when using template selectors. We already have a Bug Report with high priority in our backlog about this behavior and we hope we will be able to review it as soon as possible. Here is a link to the public item in our Feedback Portal where you can track the progress on the matter.

    I hope I've been helpful.

    Regards,
    Nikolay
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. YUANTAO
    YUANTAO avatar
    6 posts
    Member since:
    Sep 2010

    Posted 10 Feb 2018 in reply to Nikolay Link to this post

    Ok, thank you.
  4. Tino
    Tino avatar
    2 posts
    Member since:
    Sep 2017

    Posted 01 Mar 2018 in reply to Nikolay Link to this post

    Hi Nikolay, we have a problem when we use Xamarin forms RadListView for IOS. Problem is in calling the ItemTemplateSelector property. The application just crashes, and its happening just for the IOS app and not on the Android. This is a stoping issue for us, is there any feedback regarding for that? There are no exceptions, nothing, neither in try catch block with which, we can work on. The application just crashes..
  5. Nikolay
    Admin
    Nikolay avatar
    37 posts

    Posted 01 Mar 2018 Link to this post

    Hello Tino,

    I've managed to reproduce the problem by creating custom ListViewTemplateCell and I can confirm that this scenario cause exception in the iOS ListView control. I have logged a Bug Report in our backlog about this behaviour. Here is a link to the public item in our Feedback Portal where you can track the progress on the matter.

    As a workaround to your issue I'm suggesting two solutions:
    1. You can setup the TemplateSelectors without using custom ListViewTemplateCell. You can achieve every common scenario by adding custom view to the predefined ListViewTemplateCell. For more information about the ListView TemplateSelectors you can check our documentation page - link.
    2. If you have a specific ListView setup that require using custom template cell you can create a XamarinForms Effect where you will have access to the native control and you can register your custom cell  as valid view in the iOS ListView control. For your convenience I'm attaching a simple project with the implementation of the Effect for iOS. You can find more information about the Xamarin.Forms effects in the official Xamarin documentation - link.

    I hope this information helps.

    Regards,
    Nikolay
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  6. Remi
    Remi avatar
    7 posts
    Member since:
    Oct 2017

    Posted 13 Mar 2018 Link to this post

    FYI, I joust found another workaround. I can confirm the issue is happening on iOS when using an ItemTemplateSelector and a ListViewLinearLayout, but only when ItemLength is specified in the ListViewLinearLayout.

    When deleting the ItemLength property and specifying fixed height values in the data templates used by the ItemTemplateSelector, the issue is not happening anymore.

  7. Nikolay
    Admin
    Nikolay avatar
    37 posts

    Posted 15 Mar 2018 Link to this post

    Hello Remi,

    Thank you for sharing this.

    I wanted to do a quick follow up to let you know that the first issue discussed in this thread (regarding the appearance of the items) is already fixed and will be released with our next minor release in a week or two.

    Regards,
    Nikolay
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top