SfListView did not display item template containing Shape correctly

Hi team,

we are facing strange behavior of SfListView. If we put any Xamarin.Forms shape (Ellipse, Rectangle, ...) into SfListView item template, then the shape is correctly rendered the first time the list view is displayed. Any other time the listView is displayed, the shape is no more displayed.

Can you take a look what is the cause of the problem, please?

Thanks,

Regards,

Peter


Attachment: SyncfusionListViewTestApp_a21871cf.7z

3 Replies

LN Lakshmi Natarajan Syncfusion Team January 27, 2022 11:17 AM UTC

Hi Peter, 
 
We were able to reproduce the problem using a simple Ellipse without SfListView as well. The problem occurs when you add views that have already been created to the ContentView. 
 
Meanwhile, we suggest you create the ContentView to resolve the issue. Please refer to the following code snippets for more reference, 
 
private void HandleOnButton1Clicked(object sender, EventArgs e) 
{ 
    _contentView1 = new ListViewContent(); 
 
    _contentLabel.Text = "Content 1"; 
    _contentPresenter.Content = _contentView1; 
} 
 
private void HandleOnButton2Clicked(object sender, EventArgs e) 
{ 
    _contentView2 = new ListViewContent(); 
 
    _contentLabel.Text = "Content 2"; 
    _contentPresenter.Content = _contentView2; 
} 
 
We have attached the modified sample in the following link, 
 
Please let us know if you need further assistance. 
 
Regards, 
Lakshmi Natarajan 



PK Peter Kis January 27, 2022 12:35 PM UTC

Hi Lakshmi,

thank you for your quick response. 

Our ContentViews are pretty complicated, so we cache them for further use, because their creation can take "visible" amount of time (especially on older devices).

On the other hand, if we use CollectionView instead of SfListView, then shapes are displayed correctly every time...

Peter



LN Lakshmi Natarajan Syncfusion Team January 28, 2022 03:07 PM UTC

Hi Peter, 
 
The SfListView is a completely template control, and the items are laid out based on the sample level customization. We understand that the issue is not replicated in CollectionView, but the architecture for both controls will be different. The shapes disappearing issue, as mentioned in our previous update, can also be reproduced in simple Grid and BindableLayout. 
 
We have created a discussion to the Xamarin team regarding the same, 
 
Please refer to the above discussion for further updates. We will let you know once we got any updates from the Xamarin team. 
                                                                                                                                            
Please let us know if you need further assistance. 
 
Lakshmi Natarajan 
 


Loader.
Up arrow icon