iOS implementation TableView Pop-up animation when cell appears

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.