In the main UITableView for a RootViewController.
How can I add a View over a RootViewControllers TableView, with its position relative to screen and not to TableView, so it doesn't scroll with it?
Note - it will be a progress bar showing new data for the table downloading progress.
It would help if you posted your code, but: you're presumably adding the UITableView
to your RootViewController with something like this:
[self.view addSubview:myUITableView];
Just add your floating view in the same way (i.e. add it to your view controller, not to your UITableView). If you add it after you add the table view, it will already be "above" the table view. Otherwise you can bring it to the top with something like this:
[self.view bringSubviewToFront:myOverlayView];
Your overlay view should sub-class UIView
, and it should set its own backgroundColor
to [UIColor clearColor]
in order to make it transparent. In order to allow the user to continue interacting with the table view (which you presumably want to have happen), in your overlay subclass override hitTest:withEvent:
and return the table view (instead of returning self
which is the default behavior). This will pass all touches on to the table view underneath.
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