If no Table View results, display “No Results” on screen

后端 未结 14 1627
挽巷
挽巷 2020-11-30 17:25

I have a tableview, where sometimes there might not be any results to list, so I would like to put something up that says \"no results\" if the

14条回答
  •  情歌与酒
    2020-11-30 18:02

    I think the most elegant way to solve your problem is switching from a UITableViewController to a UIViewController that contains a UITableView. This way you can add whatever UIView you want as subviews of the main view.

    I wouldn't recommend using a UITableViewCell to do this you might need to add additional things in the future and things can quicky get ugly.

    You can also do something like this, but this isn't the best solution either.

    UIWindow* window = [[UIApplication sharedApplication] keyWindow];
    [window addSubview: OverlayView];
    

提交回复
热议问题