It occured that setting LayoutManager properties of RecyclerView
in the constructor do not work properly.
private TapGestureDetector detector;
public BindableRecyclerView()
- : base(new RecycleAdapter(), new LinearRecycleLayoutManager())
+ : base()
{
- // TODO workaround orientation set bug
- LayoutManager.LayoutOrientation = RecycleLayoutManager.Orientation.Horizontal;
SelectionMode = RecyclerViewSelectionMode.None;
ContentContainer.ChildAdded += ChildAddedCallback;
this.button1.ApplyStyle(Styles.Buttons.Inverse);
this.button2.ApplyStyle(Styles.Buttons.Regular);
- this.scroller.ScrollingDirection = ScrollableBase.Direction.Horizontal;
this.scroller.SelectionMode = BindableRecyclerView.RecyclerViewSelectionMode.Single;
+
+ this.scroller.LayoutManager = new LinearRecycleLayoutManager()
+ {
+ LayoutOrientation = RecycleLayoutManager.Orientation.Horizontal,
+ };
+ this.scroller.ScrollingDirection = ScrollableBase.Direction.Horizontal;
}
}
}