【发布时间】:2018-04-02 12:13:43
【问题描述】:
我在alertDialog.SetPositiveButton中有以下代码
alertConfirmTransfer.SetPositiveButton("ДА", delegate
{
ProgressBar progressBar = FindViewById<ProgressBar>(Resource.Id.progressBar);
alertConfirmTransfer.Cancel();
MobileSellReference.Service1 service = new
MobileSellReference.Service1();
progressBar.IncrementProgressBy(10);
service.Url = settings.Synchronization.Msellurl;
progressBar.IncrementProgressBy(10);
byte[][] resultFromService = service.ToPPC(basedataZipName, objectId);
progressBar.IncrementProgressBy(10);
byte[] basedataZipFile = resultFromService[0];
byte[] dutybasedataZipFile = resultFromService[3];
byte[] tranbasedataZipFile = resultFromService[2];
byte[] vendbasedataZipFile = resultFromService[1];
progressBar.IncrementProgressBy(10);
string basedataZipFullPath = GlobalVariables.fromserverFolderPath + "/" + basedataZipName;
string dutybasedataZipFullPath = GlobalVariables.fromserverFolderPath + "/" + dutybasedataZipName;
string tranbasedataZipFullPath = GlobalVariables.fromserverFolderPath + "/" + tranbasedataZipName;
string vendbasedataZipFullPath = GlobalVariables.fromserverFolderPath + "/" + vendbasedataZipName;
Helper.DeleteAllFromFolders(GlobalVariables.fromserverFolderPath, GlobalVariables.vendingFolderPath, GlobalVariables.tranFolderPath, GlobalVariables.debtFolderPath);
progressBar.IncrementProgressBy(10);
Helper.EmptyMobileSellDB();
progressBar.IncrementProgressBy(10);
System.IO.File.WriteAllBytes(basedataZipFullPath, basedataZipFile);
progressBar.IncrementProgressBy(10);
System.IO.File.WriteAllBytes(dutybasedataZipFullPath, dutybasedataZipFile);
progressBar.IncrementProgressBy(10);
System.IO.File.WriteAllBytes(tranbasedataZipFullPath, tranbasedataZipFile);
progressBar.IncrementProgressBy(10);
System.IO.File.WriteAllBytes(vendbasedataZipFullPath, vendbasedataZipFile);
progressBar.IncrementProgressBy(10);
}
我希望进度条在我指定的地方增加。但是当我运行应用程序时,我只有无限循环的进度条。我想逐渐增加。并在达到100后消失。我在 Xamarin.Android 中找到的信息太少了,但对我没有任何帮助。
【问题讨论】:
标签: xamarin.android progress-bar