本文整理汇总了C#中Xamarin.Forms.View.FadeTo方法的典型用法代码示例。如果您正苦于以下问题:C# View.FadeTo方法的具体用法?C# View.FadeTo怎么用?C# View.FadeTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Xamarin.Forms.View
的用法示例。
在下文中一共展示了View.FadeTo方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AnimateItem
private async Task AnimateItem(View uiElement, uint duration ){
while (_animate) {
await uiElement.ScaleTo(1.05, duration, Easing.SinInOut);
await Task.WhenAll (
uiElement.FadeTo(1, duration, Easing.SinInOut),
uiElement.LayoutTo (new Rectangle( new Point(0,0), new Size( uiElement.Width, uiElement.Height))),
uiElement.FadeTo(.9, duration, Easing.SinInOut),
uiElement.ScaleTo(1.15, duration, Easing.SinInOut)
);
}
}
示例2: Appearing
public override Task Appearing(View content, PopupPage page)
{
if (HasBackgroundAnimation)
{
return page.FadeTo(1, DurationIn, EasingIn);
}
if (content != null)
{
return content.FadeTo(1, DurationIn, EasingIn);
}
return Task.FromResult(0);
}
示例3: Disappearing
public override Task Disappearing(View content, PopupPage page)
{
_defaultOpacity = page.Opacity;
if (HasBackgroundAnimation)
{
return page.FadeTo(0, DurationOut, EasingOut);
}
if (content != null)
{
return content.FadeTo(0, DurationOut, EasingOut);
}
return Task.FromResult(0);
}
示例4: AnimateItem
private async Task AnimateItem( View uiElement, uint duration ){
if (uiElement == null) {
return;
}
await Task.WhenAll (new Task[] {
uiElement.ScaleTo(1.5, duration, Easing.CubicIn),
uiElement.FadeTo(1, duration/2, Easing.CubicInOut).ContinueWith(
_ => uiElement.ScaleTo(1, duration, Easing.CubicOut))
});
}
示例5: AnimateItem
private async Task AnimateItem(View uiElement, uint duration ){
var originalOpacity = uiElement.Opacity;
await uiElement.FadeTo(.5, duration/2, Easing.CubicIn);
await uiElement.FadeTo(originalOpacity, duration/2, Easing.CubicIn);
}
示例6: DroidLayout
async void DroidLayout(View mainView)
{
if (this.Content is AbsoluteLayout) {
await (this.Content as AbsoluteLayout).Children[0].FadeTo (0, (uint)Integers.AnimationSpeed, Easing.SinIn);
(this.Content as AbsoluteLayout).Children.RemoveAt (0);
AbsoluteLayout.SetLayoutFlags(mainView, AbsoluteLayoutFlags.All);
AbsoluteLayout.SetLayoutBounds(mainView, new Rectangle(0f, 0f, 1f, 1f));
(this.Content as AbsoluteLayout).Children.Insert (0, mainView);
mainView.Opacity = 0;
await mainView.FadeTo (1, (uint)Integers.AnimationSpeed, Easing.SinIn);
return;
}
fab = new FloatingActionButtonView
{
ImageName = League.IsFavorite ? "ic_favorite_white" : "ic_favorite_border_white",
ColorNormal = Color.FromHex("009688"),
ColorPressed = Color.FromHex("80CBC4"),
ColorRipple = Color.FromHex("E0F2F1"),
Clicked = (sender, args) => FabAction(),
};
absoluteAndroid = new AbsoluteLayout
{
VerticalOptions = LayoutOptions.FillAndExpand,
HorizontalOptions = LayoutOptions.FillAndExpand,
};
// Position the pageLayout to fill the entire screen.
// Manage positioning of child elements on the page by editing the pageLayout.
AbsoluteLayout.SetLayoutFlags(mainView, AbsoluteLayoutFlags.All);
AbsoluteLayout.SetLayoutBounds(mainView, new Rectangle(0f, 0f, 1f, 1f));
absoluteAndroid.Children.Add(mainView);
// Overlay the FAB in the bottom-right corner
AbsoluteLayout.SetLayoutFlags(fab, AbsoluteLayoutFlags.PositionProportional);
AbsoluteLayout.SetLayoutBounds(fab, new Rectangle(1f, 1f, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize));
absoluteAndroid.Children.Add(fab);
Content = absoluteAndroid;
await mainView.FadeTo (1, (uint)Integers.AnimationSpeed, Easing.SinIn);
}