protected override LinearLayout CreateNativeControl()
{
- return new LinearLayout(Context) { Orientation = Orientation.Horizontal };
+ return new LinearLayout(Context)
+ {
+ Orientation = Orientation.Horizontal,
+ Focusable = true,
+ DescendantFocusability = DescendantFocusability.AfterDescendants
+ };
}
protected override void OnElementChanged(ElementChangedEventArgs<Stepper> e)
if (e.OldElement == null)
{
- _downButton = new AButton(Context) { Text = "-", Gravity = GravityFlags.Center, Tag = this };
+ _downButton = new AButton(Context) { Text = "-", Gravity = GravityFlags.Center, Tag = this, Focusable = true };
_downButton.SetHeight((int)Context.ToPixels(10.0));
_downButton.SetOnClickListener(StepperListener.Instance);
- _upButton = new AButton(Context) { Text = "+", Tag = this };
+ _upButton = new AButton(Context) { Text = "+", Tag = this, Focusable = true };
_upButton.SetOnClickListener(StepperListener.Instance);
_upButton.SetHeight((int)Context.ToPixels(10.0));
+ _downButton.NextFocusForwardId = _upButton.Id = Platform.GenerateViewId();
+
var layout = CreateNativeControl();
layout.AddView(_downButton);