버튼이
회전하는 간단한 애니메이션 코드입니다. 재물로 버튼을 디자인하고 클릭하면 360도 회전하도록 되어 있습니다.
<?xml version="1.0" encoding="utf-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="clr-namespace:DemoAnimation" x:Class="DemoAnimation.DemoAnimationPage">
<Button x:Name="button"
Text="Tap Me!"
FontSize="Large"
HorizontalOptions="Center"
VerticalOptions="Center"
Clicked="OnButtonClicked" />
</ContentPage>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="clr-namespace:DemoAnimation" x:Class="DemoAnimation.DemoAnimationPage">
<Button x:Name="button"
Text="Tap Me!"
FontSize="Large"
HorizontalOptions="Center"
VerticalOptions="Center"
Clicked="OnButtonClicked" />
</ContentPage>
using Xamarin.Forms;
using System;
namespace DemoAnimation
{
public partial class DemoAnimationPage : ContentPage
{
public DemoAnimationPage()
{
InitializeComponent();
}
void OnButtonClicked(object sender, EventArgs args)
{
button.RotateTo(360);
}
}
}
using System;
namespace DemoAnimation
{
public partial class DemoAnimationPage : ContentPage
{
public DemoAnimationPage()
{
InitializeComponent();
}
void OnButtonClicked(object sender, EventArgs args)
{
button.RotateTo(360);
}
}
}