首页 > 其他 > 详细

[翻译] VICMAImageView

时间:2015-02-08 23:09:15      阅读:364      评论:0      收藏:0      [点我收藏+]

VICMAImageView

技术分享

https://github.com/vitoziv/VICMAImageView

  

Change image view‘s content mode with your animation!

修改 imageView 的contentMode属性就有动画效果!

技术分享

 

Installation

Cocoapods

pod ‘VICMAImageView‘, ‘~> 1.0‘

用Cocoapods安装

pod ‘VICMAImageView‘, ‘~> 1.0‘

 

Usage

Use VICMAImageView like a UIImageView

就像使用UIImageView那样子来使用VICMAImageView

- (void)viewDidLoad {
    [super viewDidLoad];
    UIImage *image = [UIImage imageNamed:@"1.jpg"];
    VICMAImageView *imageView = [[VICMAImageView alloc] initWithImage:image];
    imageView.frame = CGRectMake(0, 0, 100, 100);
    [self.view addSubview:imageView];
}

Animate contentMode in animation block

在animation的block中赋值就可以看到动画效果了.

[UIView animateWithDuration:0.3
                     animations:^{
                         imageView.contentMode = UIViewContentModeScaleAspectFill;
                     }];

 

License

VICMAImageView is available under the MIT license. See the LICENSE file for more info.

VICMAImageView遵循MIT协议,你可以查看MIT协议了解更多.

 

[翻译] VICMAImageView

原文:http://www.cnblogs.com/YouXianMing/p/4280581.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!