Find a simple way to make tableview very cool, the language description is too pale, look directly at the picture bar:
In any cell first appeared on the screen when there will be such an effect, very smooth, but also very interesting (can not stop playing with. )。 The implementation is also very simple, iOS native support, a few lines of code can be done, in the numerous TableView proxy methods, we use the following method:
-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
This method is to operate the cell at the Indexpath location when the cell is about to be displayed, and we'll add the animated code to this method, which is simply to change the cell from a small to a normal size. Using UIView simple animations can be implemented (about UIView simple animations can be seen in my blog: iOS basic animation tutorial). The code is as follows:
//Add animation to cell-(void) TableView: (UITableView*) TableView Willdisplaycell: (UITableViewCell*) Cell Forrowatindexpath: (Nsindexpath*) indexpath{//Set cell animation effect to 3D effect //Set the initial value of x and Y to 0.1;Cell. Layer. Transform= Catransform3dmakescale (0.1,0.1,1);the final value of//x and Y is 1[UIViewAnimatewithduration:1animations:^{cell. Layer. Transform= Catransform3dmakescale (1,1,1); }];}
In the usual TableView code to add this method can be achieved, very simple, but the effect is very good! You can click to view my sample project
All rights reserved: Http://blog.csdn.net/cloudox_
iOS implementation TableView Pop-up animation when cell appears