iosobjective-cmbprogresshud

MBProgressHud and issues with the constraints


I am trying to show a toast using the MBProgressHud and here's the code,

MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:view animated:YES];
[hud setMode:MBProgressHUDModeText];
[hud setLabelText:toastText];
hud.labelText.accessibilityLabel = toastText;
hud.yOffset = offset;
[hud hide:YES afterDelay:1.5f];

The yoffset can be used to push the toast down. Can this have constraints ? Does MBProgressHUD come with layout constraints. I need to show this just above the of the screen and it should work for all resolutions.


Solution

  • I ultimately used self.view.frame/2 - 100 which works fine for most the screen resolutions the project work on supports.