开发者

Alternate text for empty UITableView?

I am using a UITableView to display some data which the user can filter. If a certain (perfectly "legal") combination is selected, all data is filtered out (hidden). I would like to display some text stating that no results were found and to please modify your filters.

Does anything trigger when this occurs that I can hook in to?

Or will I have to manually check for an empty data set and create a custom view to display my text? (I was thinking of creating a blank cell and using that footer? Ho开发者_开发知识库ping for something more elegant...)

I found a similar question, but the solution is not what I am looking for: Handling empty UITableView in UITableViewController

Also, I have an Android programming background and use this exact feature frequently, I would be surprised if Apple didn't do this as well!


Put a custom view with your error text message behind the table. Then when there is no data to be displayed set table.alpha=0.0 (or table.hidden=YES), while when you have this data available set table.alpha=1.0 (or table.hidden=NO). You can do the control on the "OK" button (or equivalent) of the filter.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜