I have a regular-style UITableView—the one that has a white background and gray horizontal lines to separate the rows.
I have another custom UIView that is just a 100×100 rectangle filled with redColor.
How can I put the latter into the former, such that it appears over the horizontal lines, but is still a “part” of the table view in the sense that when I scroll the table view around, the red view scrolls with it? In fact, I should also be able to put my finger on the red area and scroll the table view.
Once again, if the red view is placed to overlap some horizontal lines, it should appear over the lines. Sadly, when I just add the red view as a subview to the table view, the horizontal lines go over the red view; see this screenshot.
How can this be accomplished?
EDIT
If you are trying to add the view a above the lines (hide the lines) try to use
– bringSubviewToFront:to take it to the front of the table view.ELSE
Add the view to the
self.tableView.tableHeaderViewthis will place it above the table view and will scroll with the table view.Good Luck