文章来源:淘论文网   发布者: 毕业设计   浏览量: 27



还可以点击去查询以下关键词:
[可折叠]    [定制]    [ITAbleViewCell]    [可折叠U定制ITAbleViewCell]   

项目介绍:

看到code 4APP上有一个折叠的UITAbleViewCell,不过是swift的,所以自己尝试做一个简单的可折叠的UITAbleViewCell主要实现一个可以折叠的UITAbleViewCell
1.单边圆角:我们经常会遇到一些情况需要进行单边圆角或者边界线的设置,论文,我简单封装了一个类别,github网址

2.锚点的更改项目中主要围绕view上边界进行3d旋转,所以在动画之前需要进行锚点的设置。
关于锚点的详细概念,可以参考我的另一篇博客:点击这里
因为锚点改变时,frame也会变动,开题报告,所以在改变锚点时需要重新设置frame。
我这里主要用下面的代码进行锚点的更改:

- (void)setAnchorPointToCGPoint)point viewUIView*)view{    /*         CGRect frame = view.frame;    frame.origin.x+=(point.x - view.layer.anchorPoint.x) * view.frame.size.width;    frame.origin.y+=(point.y - view.layer.anchorPoint.y) * view.frame.size.height;    view.frame = frame;    view.layer.anchorPoint = point; */    //和上面注销掉的代码一个意思    view.frame = CGRectOffset(view.frame, (point.x - view.layer.anchorPoint.x) * view.frame.size.width, (point.y - view.layer.anchorPoint.y) * view.frame.size.height);    view.layer.anchorPoint = point;}

3.旋转动画;关于旋转动画,我用的是下面的方法:
[UIView animateWithDuration:0.3 animations:^{        self.ThirdView.layer.transform=CATransform3DMakeRotation(M_PI_2, 1, 0, 0);            }completion:^(BOOL finished) {}];
当然你也可以用这个方法:
    CABasicAnimation* rotationAnimation;    rotationAnimation = [CABasicAnimation animationWithKeyPath:@'transform.rotation.x'];    [self setAnchorPointTo:CGPointMake(0.5, 0) view:self.secondView];    rotationAnimation.fromValue = [NSNumber numberWithFloat: M_PI ];    rotationAnimation.toValue = [NSNumber numberWithFloat: 0 ];    rotationAnimation.duration = 3;    rotationAnimation.cumulative = YES;    rotationAnimation.repeatCount = 1;

4.md34采用md34属性进行类似于翻页效果的设置,关于md34属性网上有很多文章说明,这里不做详细解释。
具体代码为:
//给containView添加偏移    CATransform3D transfrom3d = CATransform3DIdentity;    transfrom3d.m34 = -0.002;    self.InnerView.layer.sublayerTransform = transfrom3d;


5.阴影:
-(void)setShadowUIView*)targetView{    //阴影    targetView.layer.shadowOpacity = 1.0;// 阴影透明度    targetView.layer.shadowColor = [UIColor grayColor].CGColor;// 阴影的颜色    targetView.layer.shadowRadius = 3;// 阴影扩散的范围控制    targetView.layer.shadowOffset  = CGSizeMake(3, 3);// 阴影的范围}


Demo地址:点击这里
有什么bug,还请告知。
有什么bug,还请告知。


这里还有:


还可以点击去查询:
[可折叠]    [定制]    [ITAbleViewCell]    [可折叠U定制ITAbleViewCell]   

请扫码加微信 微信号:sj52abcd


下载地址: http://www.taolw.com/down/6522.docx
  • 上一篇:再发一次我的类似QQ,微信的弹出框架
  • 下一篇:仿美团首毕业设计页菜单