看一看
PageRenderer
源代码(
see here for Android
Image
就像你想象的那样
void UpdateBackgroundImage(Page view)
{
if (!string.IsNullOrEmpty(view.BackgroundImage))
this.SetBackground(Context.GetDrawable(view.BackgroundImage));
}
他们宁愿把它直接放在本机控件中。这意味着您必须模拟背景图像才能获得动画效果(这个词是否存在?)。
Grid
(
AbsoluteLayout
-
这个
网格
各有一行和一列
-
图像
应在任何其他子项之前(在集合中,不一定是临时的)添加包含背景的
-
如果没有背景
图像
-
如果已经有背景图像,则新图像将添加
Opacity
等于0
-
-
一个用来淡化旧形象的
-
使新图像淡入
private void FadeViews(View newView, View currentView)
{
newView.Opacity = 0;
Grid.Children.Insert(0, newView);
newView.Animate("FadeIn", d => newView.Opacity = d, 0, 1);
newView.Animate("FadeOut", d => currentView.Opacity = d, 1, 0, finished: (_, __) => this.Grid.Children.Remove(currentView));
}
因为我在用
TranslateTo
而不是
Animate