Reputation: 41
Can any one Please provide Numeric UpDown Control demo with Xamarin Forms Does this control Available in Xamarin Forms? thanks Prashanth
Upvotes: 4
Views: 7747
Reputation: 336
You can use Stepper
for this:
XAML
<Stepper Value="5"
Minimum="0"
Maximum="10"
Increment="0.1"
HorizontalOptions="LayoutOptions.Center"
VerticalOptions="LayoutOptions.CenterAndExpand"
ValueChanged="OnValueChanged" />
void OnValueChanged(object sender, ValueChangedEventArgs e) {
lbldisp.Text = String.Format("Stepper value is {0:F1}", e.NewValue);
}
Upvotes: 4
Reputation: 131
https://learn.microsoft.com/en-us/dotnet/api/xamarin.forms.stepper?view=xamarin-forms maybe this could help. you might want to write a custom render for putting that textBox in between the -/+ buttons but sure if you can use as it is, it works fine.
Upvotes: 1
Reputation: 11105
See edit #2.
No there is not a spinner control out-of-the-box. If you do not want to get creative, you could use the Picker
control and insert predefined values into it. Picker
info here.
Otherwise it would be pretty trivial to create an up and down Button
and an Entry
or Label
. Clicking the up Button
increments a number in the Entry
or Label
. Clicking the down Button
decrements a number in the Entry
or Label
.
*Edit: Just happened to land on Syncfusion's NumericUpDown control which does want you want. You can also get a free community license for the control if you are a lone developer or a group of 5 or fewer people. Community License info here
*Edit #2: Was looking through the Xamarin Views list page here and saw that actually do have a Stepper
control now!
Upvotes: 8