|
Tela

Fonte
using System;
using Xamarin.Forms;
namespace VisualTeste
{
public class App : Application
{
Entry edInteiro;
public App ()
{
edInteiro = new Entry ();
edInteiro.Keyboard = Keyboard.Numeric;
edInteiro.WidthRequest = 80;
edInteiro.Text = "5";
edInteiro.HorizontalOptions = LayoutOptions.Start;
Stepper stepper = new Stepper
{
Minimum = 0,
Maximum = 10,
Value = 5,
Increment = 1, // aceita 0.1
HorizontalOptions = LayoutOptions.Start
} ;
stepper.ValueChanged += OnStepperValueChanged;
StackLayout layoutHorz = new StackLayout ();
layoutHorz.Orientation = StackOrientation.Horizontal;
layoutHorz.Children.Add (edInteiro);
layoutHorz.Children.Add (stepper);
StackLayout layoutVert = new StackLayout ();
layoutVert.Children.Add (layoutHorz);
ContentPage pag = new ContentPage ();
pag.Content = layoutVert;
MainPage = pag;
}
void OnStepperValueChanged(object sender, ValueChangedEventArgs e)
{
edInteiro.Text = e.NewValue.ToString ();
}
}
}
|