在Xamarin
,我有一个简单的Activity
加载与另一个Activity
加载前五秒钟的等待。图片将不会显示在内容视图
第一个Activity
的图像作为Layout
的一部分,但此图像未显示。
这里是我的Activity
代码:
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);
SetContentView (Resource.Layout.SplashActivity);
Thread.Sleep(5000);
var testActivity = new Intent (this, typeof(TestStartup));
StartActivity (testActivity);
}
这里是我的SplashActivity
布局代码:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/background_color">
<ImageView
android:src="@drawable/Splash"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/SplashImage"
android:layout_gravity="center_vertical" />
</LinearLayout>
的应用程序等待五秒钟,然后TestStartup Activity
负荷,但是,图像不在五秒钟等待期间显示。如何在Activity
等待5秒钟时显示此图像?
我可以请这个代码帮忙吗?
在此先感谢