Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# “什么是”呢;“屏幕外”;及;“在屏幕上”;在Xamarin.表单动画中?_C#_Xamarin_Xamarin.forms - Fatal编程技术网

C# “什么是”呢;“屏幕外”;及;“在屏幕上”;在Xamarin.表单动画中?

C# “什么是”呢;“屏幕外”;及;“在屏幕上”;在Xamarin.表单动画中?,c#,xamarin,xamarin.forms,C#,Xamarin,Xamarin.forms,它的文档中说: 为从外部接收用户触摸输入的视图设置动画 在屏幕上,开发人员必须首先在最终视图中布置视图 定位,然后将视图平移到屏幕外,最后设置动画 将视图返回到屏幕上的最终位置。[我的重点] (在注释中)还说: 如果元素最初在屏幕外布局,然后转换 在屏幕上,翻译后元素的输入布局保持不变 屏幕外,用户无法与其交互。因此,它是 建议在最终位置布置视图,并且 然后执行所需的任何翻译。[我的重点] 这在代码中意味着什么?根据,答案似乎是我们需要: child.X = <destination (w

它的文档中说:

为从外部接收用户触摸输入的视图设置动画 在屏幕上,开发人员必须首先在最终视图中布置视图 定位,然后将视图平移到屏幕外,最后设置动画 将视图返回到屏幕上的最终位置。[我的重点]

(在注释中)还说:

如果元素最初在屏幕外布局,然后转换 在屏幕上,翻译后元素的输入布局保持不变 屏幕外,用户无法与其交互。因此,它是 建议在最终位置布置视图,并且 然后执行所需的任何翻译。[我的重点]

这在代码中意味着什么?

根据,答案似乎是我们需要:

child.X = <destination (which is somewhere that the user can see)>
child.TranslateX = <somewhere not seen>
child.TranslateTo(0)
child.X=
child.TranslateX=
child.TranslateTo(0)
(伪代码,因为我现在无法测试它)

根据,答案似乎是我们需要:

child.X = <destination (which is somewhere that the user can see)>
child.TranslateX = <somewhere not seen>
child.TranslateTo(0)
child.X=
child.TranslateX=
child.TranslateTo(0)

(伪代码,因为我现在无法测试它)

屏幕外,例如,您有一个图像,但您将此图像置于屏幕外,您无法在ContentPage UI中看到此图像,在屏幕上,意味着您放入ContentPage的图像,您可以在ContentPage中看到图像。如果图像先离开屏幕,然后你翻译到屏幕上,现在你可以看到它,但你可能无法与它互动,因为图像的真实位置仍然离开屏幕,@CherryBu MSFT谢谢。我在你的评论上发布了一个答案,如果我误解了你,请让我知道。屏幕外,例如,你有一个图像,但你把这个图像放在屏幕外,你在ContentPage UI中看不到这个图像,在屏幕上,意味着你放在ContentPage中的图像,你可以在ContentPage中看到图像。如果图像先离开屏幕,然后你翻译到屏幕上,现在你可以看到它,但你可能无法与它互动,因为图像的真实位置仍然离开屏幕,@CherryBu MSFT谢谢。我在你的评论上贴了一个答案,如果我误解了你,请让我知道。