iOS 7 - How to display a date picker in place in a

2019-01-03 03:34发布

In WWDC 2013 video, Apple suggests displaying picker in place in a table view in iOS 7. How to insert and animate a view between table view cells?

Like this, from the Apple calendar app:

In-place date picker

13条回答
淡お忘
2楼-- · 2019-01-03 04:40

I found an answer to a flaw in apple's datecell example where you must have a row below the last datecell or you get an error. In CellForRowAtIndexPath method replace ItemData line with

NSArray *itemsArray = [self.dataArray objectAtIndex:indexPath.section];
NSDictionary *itemData = nil;

if(![indexPath isEqual:self.datePickerIndexPath])
    itemData = [itemsArray objectAtIndex:modelRow];

After replacing the sample code I can now display display a datePicker cell without having a cell beneath it.

I just joined stackoverflow so if this is in the wrong place or somewhere else I apologize.

查看更多
登录 后发表回答