开发者

How to draw or put a text on empty an UITableViewController?

I have a app that starts with a empty UITableViewController, which is pretty .. well, emtpy. Now I was wondering if I could hint the user by painting something else on the view, like pointing an arrow to the plus button and say something like "press here to add something new"

I'll guess I have to do this in the viewDidLoad method, where I also init my NSFetchedResultsController, so I actually know if there are any objects in my list. I 开发者_如何学Cnever put controls on the screen by code so I am not sure where to start and where to put em on. will that be the [self view] ?

Thanks


You could either try [tableview addSubview:xyz] or add it to the UITableViewController holding viewcontroller or you could (iphonestyle) add an add button to the NavigationBar.


  1. I wouldn't direct the user to "press" anything, ever, on iOS. Use "tap" instead.

  2. If you're using standard UI, you'll probably have a button that looks like [+], which is consistent enough across iPhone apps that your prompt should be unnecessary.

  3. If you still want to add your prompt, I would subclass a UIViewController, implement the UITableViewDelegate and UITableViewDataSource protocols, and add a the prompt (which itself will be a subclass of UIView) to the view hierarchy of the controller.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜