The TableView cell is animated by the broken boat.

Source: Internet
Author: User

First assume that you are already skilled in using UITableView. Then we only need to implement Uitableviewdelegate in the TableView:WillDisplayCell:ForRowAtIndexPath: can. When the cell is displayed, the method is called first, so the cell is animated, in this way. (Instant explosion)

-(void) TableView: (uitableview *) TableView Willdisplaycell: (uitableviewcell *) cell Forrowatindexpath: (nsindexpath *) indexpath{

//1. Configuring the contents of catransform3d

catransform3d transform;

Transform = catransform3dmakerotation((90.0*m_pi)/in- 0.0 , 0.7 , 0.4);

Transform. M34 = 1.0/-;

//2. defining The initial state of a cell

Cell. layer. Shadowcolor = [[uicolor blackcolor]cgcolor];

Cell. layer. Shadowoffset = cgsizemake(ten );

Cell. Alpha = 0;

Cell. layer. Transform = transform;

Cell. layer. Anchorpoint = cgpointmake(0, 0.5);

//3. define The final state of the cell and commit the animation

[UIView beginanimations:@ "Transform" context:NULL];

[UIView setanimationduration:0.5];

Cell. layer. Transform = catransform3didentity;

Cell. Alpha = 1;

Cell. layer. Shadowoffset = cgsizemake(0, 0);

Cell. frame = cgrectmake(0, cell. Frame. Origin. Y, cell. Frame. Size. Width, cell. Frame. Size. Height);

[UIView commitanimations];

}

The TableView cell is animated by the broken-boat brother

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.