Skip to content

Commit 3847d7d

Browse files
committed
Fixed snap to scroll issue on orientation changed
1 parent c8686b3 commit 3847d7d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/Droid/Renderers/CarouselLayoutRenderer.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,5 +114,14 @@ public override void Draw (Canvas canvas)
114114
var carouselLayout = (CarouselLayout)this.Element;
115115
_scrollView.ScrollTo (carouselLayout.SelectedIndex * Width, 0);
116116
}
117+
118+
protected override void OnSizeChanged(int w, int h, int oldw, int oldh)
119+
{
120+
if(_initialized && (w != oldw))
121+
{
122+
_initialized = false;
123+
}
124+
base.OnSizeChanged(w, h, oldw, oldh);
125+
}
117126
}
118127
}

0 commit comments

Comments
 (0)