开发者

Before data is entered, is there a way to make a grouped table graphic placeholder?

I have a grouped table with 3 sections, each section with a title. The 1st and 3rd sections always have only 1 row of information so before any user data is entered, I just put some words like "Enter Data Here..." as placeholder text. This text is edited (replaced) by the user with their own actual data. No problem.

The 2nd section however will contain several rows of information entered by user and I'd prefer not to enter placeholder data in row 0, having the user Edit the first row of data then Add subsequent rows.

If the numberOfRowsInSection is set to 0, the title for the 3rd section comes close to the title for the 2nd section and it looks ugly.

The best that I could come with, and I don't know to do it, is to have a fake graphic placeholder 开发者_C百科on the striped background (between the 2nd and third titles) that looks like a single row in the 2nd section, put "Enter Data Here..." text in the graphic, and then the first row of actual data entered and all subsequent rows will cover it up.

Can anyone tell me how to do this or offer a better suggestion. Thanks.


Put one row in the second section and then hide it with some like this in your - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath method:

if (indexPath.section == 1 && indexPath.row == 0) cell.hidden = YES;

The cell will not be visible, but the space for the cell remains.

Hope that helps you.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜