I am displaying a HUD while populating the TableView, but it seems to be showing behind the TableView (tableview separator breaking the hud).
Here's the code in the TableViewController:
- (void)viewDidLoad {
[super viewDidLoad];
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
hud.mode = MBProgressHUDModeText;
hud.labelText = @"Loading";
// Populate the table
[self getTableData];
self.tableView.rowHeight = 90;
}
It's doing this only with TableViews.
The issue here is that you are adding the HUD when the view loads, which is likely before your tableView has been displayed, so the tableView is created and appears to cover the HUD. Move that code into viewDidAppear and your problem will go away:
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
hud.mode = MBProgressHUDModeText;
hud.labelText = @"Loading";
}
Use self.navigationController.view
instead of self.view
if you want to implement in viewDidLoad
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With