This is a migrated thread and some comments may be shown as answers.

custom template selector shows no data in IOS

6 Answers 156 Views
ListView
This is a migrated thread and some comments may be shown as answers.
YUANTAO
Top achievements
Rank 1
YUANTAO asked on 07 Feb 2018, 08:27 AM

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.

6 Answers, 1 is accepted

Sort by
0
Accepted
Nikolay
Telerik team
answered on 09 Feb 2018, 01:01 PM
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
0
YUANTAO
Top achievements
Rank 1
answered on 11 Feb 2018, 02:10 AM
Ok, thank you.
0
Tino
Top achievements
Rank 1
answered on 01 Mar 2018, 09:10 AM
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
0
Nikolay
Telerik team
answered on 01 Mar 2018, 03:14 PM
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
0
Remi
Top achievements
Rank 1
answered on 13 Mar 2018, 03:13 PM

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.

0
Nikolay
Telerik team
answered on 15 Mar 2018, 11:06 AM
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
Tags
ListView
Asked by
YUANTAO
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
YUANTAO
Top achievements
Rank 1
Tino
Top achievements
Rank 1
Remi
Top achievements
Rank 1
Share this question
or