我有以下MainActivity
当我单击其GO TO SECOND ACTIVITY
按钮时,我转到SecondActivity
,但是像在SecondActivity
中一样,我有一个很大的可缩放图像,该应用程序在MainActivity
上停留约2、3秒钟,然后打开SecondActivity
。阻止用户认为GO TO SECOND ACTIVITY
按钮不起作用,我想在用户按下SecondActivity
按钮后立即打开GO TO SECOND ACTIVITY
,并在加载图像时显示加载微调器代替图像。
这里是我的SecondActivity.axml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageLoadingDemo.ScaleImageView
android:src="@drawable/ic_map"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
您首先添加一个像“ urlimageviewhelper”这样的nuget包,对我来说效果很好然后使用此代码代替常用方法
Koush.UrlImageViewHelper.SetUrlDrawable(ImageViewSample, "ImageUrl", Resource.Drawable.Preloaing, IntNumber);
在以上代码中,将600000用于10减去缓存ImgaeResource.Drawable.Preloaing:这是预加载图片