You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
thank you very much for creating that control!
At the Android CarouselLayoutRenderer.updateSelectedIndex() function, you need to ensure that the carouselLayout.SelectedIndex Property should be set at the UI Thread. Otherwise all of a sudden the PropertyBinding didn't work anymore. I update it like this:
`
private void updateSelectedIndex()
{
var center = _scrollView.ScrollX + (_scrollView.Width / 2);
var carouselLayout = (CarouselLayout)Element;
var calculatedIdx = (center / _scrollView.Width);
using (var h = new Handler(Looper.MainLooper))
{
h.Post(() => carouselLayout.SelectedIndex = calculatedIdx);
}
}
`
Hope that helps someone.
The text was updated successfully, but these errors were encountered:
Hi,
thank you very much for creating that control!
At the Android CarouselLayoutRenderer.updateSelectedIndex() function, you need to ensure that the carouselLayout.SelectedIndex Property should be set at the UI Thread. Otherwise all of a sudden the PropertyBinding didn't work anymore. I update it like this:
`
private void updateSelectedIndex()
{
var center = _scrollView.ScrollX + (_scrollView.Width / 2);
var carouselLayout = (CarouselLayout)Element;
var calculatedIdx = (center / _scrollView.Width);
`
Hope that helps someone.
The text was updated successfully, but these errors were encountered: