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

Fill SfRotator using a StackLayout inside a SfRotatorItem

Good evening,

I recently implemented the control SfRotator and I had some issues. The first one is when we fill our rotator with some data using SfRotatorItem, it looks like we can't wrap anything into a StackLayout. The item is well loaded, but nothing is displayed even if the documentation said that ItemContent should accept a view. Here is my code :

[CODE]
if (e.PropertyName == nameof(context.News))
{
  var rotator = new SfRotator() { BackgroundColor = Color.Transparent, HeightRequest = 200};

  foreach (var item in context.News)
  {
    var stack = new StackLayout() { Children = { new Label() { Text = "Test"} } };
    var rotatorItem = new SfRotatorItem() { ItemContent = stack };
    rotator.DataSource.Add(rotatorItem);
  }

 RotatorLayout.Children.Add(rotator);
[/CODE]

I thank you in advance for your answer and I wish you a good evening !
Best regards,

3 Replies

RK Rathana Kumar Sekar Syncfusion Team February 2, 2017 01:29 PM UTC

Hi Toussaint 

Thanks for contacting Syncfusion Support. 

We are currently working on you reported feature.It will be available our upcoming volume release 1,2017 which will be available on first week of February.We can achieve your requirment using populate the item through ItemTemplate.We have prepared sample to show demo on "How to populate the items through ItemTemplate". Please find the sample from below. 

Regards,
Rathanakumar S
 



MT mtwsm February 6, 2017 04:41 PM UTC

Hi Rathana Kumar,

Your solution is pointing now to another issue that I had and that pushed me to use SfRotatorItem. Indeed, your sample is working fine, but when I fill my rotator with some data coming from an async method, this seems to lead on an update issue. 

I could provide you some code, but it's very similar to what you gave me beside the async method. Could you check it out ?

Best regards, 
mtwsm


RK Rathana Kumar Sekar Syncfusion Team February 7, 2017 12:20 PM UTC

Hi Toussaint,

Thanks for your update.

We are currently facing some issue in ItemContent API of SfRotator. A support incident to track the status of the issue has been created under your account.  Please log on to our support website to check for further updates.


  
Regards,
Rathanakumar S


Loader.
Live Chat Icon For mobile
Up arrow icon