2017-02-15 80 views
1

使用Xamarin.iOS是有可能改變在UIActivityIndicatorView圖像的默認圖像看起來是這樣的:Xamarin的iOS活動指示燈與其它圖像

enter image description here

,我想用這樣一個形象:

enter image description here

+0

你正在使用什麼活動指示器(什麼類)?你在使用特定的nuget包嗎?你在調用指標的代碼在哪裏? 我們需要更多的信息來幫助你。 – valdetero

+0

我在我的webview中使用默認指標。 當我開始加載使指標startAnimation,在完成負載indicatorStopAnimation。 –

回答

1

您可以在使用動畫屬性一個UIImageView像這樣:

var images = new UIImage[40]; 
for (int i = 0; i < 40; i++) 
{ 
    images[i] = UIImage.FromBundle($"Frame{i}"); 
} 
ImageView.Image = images[0]; 
ImageView.AnimationImages = images; 
ImageView.AnimationDuration = 2; 

您就可以開始與停止:

ImageView.StartAnimating(); 
ImageView.StopAnimating(); 

我做了這個here的演示,它看起來是這樣的:

Alt Text

還需要將生成的圖像裝載機你想要的。

+0

感謝您的幫助@Iain Smith –

+0

真棒是否幫助解決了您的問題? –