효과를 위해 WebView를 사용해보십시오. 모든 플랫폼에서 작동합니다. 먼저 애니메이션을위한 XML 파일을 작성해야합니다.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<WebView
android:id="@+id/webLoadingIcon"
android:layout_width="44dp"
android:layout_height="44dp"
android:layout_gravity="center_horizontal|center_vertical"
android:layout_marginTop="120dp"
android:background="#00000000"
/>
</LinearLayout>
은 "webLoadingIcon는"사용하려는 .gif 참고 사진의 이름을 나타냅니다 : 이 XML 파일에 대한 내 샘플입니다. 그런 다음 화면에서 .gif 사진을 사용하고로드하는 메서드를 만듭니다.
void LoadAnimatedGif()
{
webLoadingIcon = currentView.FindViewById<WebView>(Resource.Id.webLoadingIcon);
// expects to find the 'loading_icon_small.gif' file in the 'root' of the assets folder, compiled as AndroidAsset.
webLoadingIcon.LoadUrl(string.Format("file:///android_asset/loading_icon_small.gif"));
// this makes it transparent so you can load it over a background
webLoadingIcon.SetBackgroundColor(new Color(0,0,0,0));
webLoadingIcon.SetLayerType(LayerType.Software, null);
}
희망 나는 당신에게 조금 도움이 : 이 샘플입니다! :)