I need to show the status of loading in horizontal progress bar. I am using the package MBProgressHUD in xamarin ios
I have this method,
public void ShowProgressBar(string title, string message, int max, int
progress)
{
UIViewController controller =
UIApplication.SharedApplication.KeyWindow.RootViewController;
hud = new MTMBProgressHUD(controller.View);
controller.View.AddSubview(hud);
hud.Color = UIColor.Clear.FromHex(0x8BC34A);
hud.Mode = MBProgressHUDMode.DeterminateHorizontalBar;
hud.Progress = progress;
}
max value is 18, and progress parameter starts from 1 and this method calls 18 times. when this method first call'd, progress bar fully loads, which is wrong. How to load this progress based on the progress value?
Thanks
I noticed that you declared the parameters
progressasint.In fact ,you should declare it asfloat, because the range of progress is from0to1. For example ,you can improve your code as following: