Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/286.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/105.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#_Ios_Xamarin_Cross Platform - Fatal编程技术网

C# 如何在Xamarin表单中按顺序显示(显示)元素

C# 如何在Xamarin表单中按顺序显示(显示)元素,c#,ios,xamarin,cross-platform,C#,Ios,Xamarin,Cross Platform,我有一个网格的按钮(2 x 3),这将始终是我的应用程序固定大小的菜单 我想在开始时显示它们,以稍微延迟的顺序显示(从左到右,从上到下) 我试过这样做: 在onAppearing方法中,使用FadeTo动画和延迟按顺序显示元素: await schedule_label_shadow.FadeTo(0, 1); await schedule_label.FadeTo(0, 1); await employees_label.FadeTo(0, 1); await employees_la

我有一个网格的按钮(2 x 3),这将始终是我的应用程序固定大小的菜单

我想在开始时显示它们,以稍微延迟的顺序显示(从左到右,从上到下)

我试过这样做:

在onAppearing方法中,使用FadeTo动画和延迟按顺序显示元素:

 await schedule_label_shadow.FadeTo(0, 1);
 await schedule_label.FadeTo(0, 1);
 await employees_label.FadeTo(0, 1);
 await employees_label_shadow.FadeTo(0, 1);

 await schedule_label.FadeTo(1, 250);
 await schedule_label_shadow.FadeTo(1, 250);
 await employees_label.FadeTo(1, 250);
 await employees_label_shadow.FadeTo(1, 250);
它可以工作,但我必须先淡出,所以元素不会在开始时显示。然而,这似乎不是一个正确或有效的方式来做这样的动画。我还想尝试isVisible(true/false),但有人告诉我这是一种糟糕的做法,因为它会阻塞UI线程


你能告诉我我做得对吗?或者告诉我方向正确吗?

你需要在明细表、标签、阴影和其他视图中设置不透明度=0。还可以从xaml设置属性

 schedule_label.Opacity = 0;
移除

 await schedule_label_shadow.FadeTo(0, 1);

在明细表、标签、阴影和其他视图中,需要将不透明度设置为0。还可以从xaml设置属性

 schedule_label.Opacity = 0;
移除

 await schedule_label_shadow.FadeTo(0, 1);

嗨,你能分享一下想要的效果吗?检查哪种方式最好会很有帮助。嗨,你能分享一下想要的效果吗?这将有助于检查哪种方式是最好的。