Xamarin : Button Formatting & Click Event


Xamarin : Button Formatting & Click Event


Design


<StackLayout Orientation="Vertical">

    <Button Text="Different color"
           TextColor="Yellow"
           BackgroundColor="Blue"></Button>

    <Button Text="Font Size"
           FontSize="20">
    </Button>

    <Button Text="Margin"
           Margin="20"></Button>

    <Button Text="Center"
           HorizontalOptions="Center"
            VerticalOptions="Center">
    </Button>

    <Button Text="Verticle Button"
           Rotation="20"
            BorderWidth="20" Clicked="btnClick">
    </Button>

  </StackLayout>


Code:


       void btnClick(object sender, EventArgs e)
        {
            DisplayAlert("Button Click", "You clicked on button :)", "Okay");
        }

No comments:

Post a Comment