[翻译] VICMAImageView

简介:

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协议了解更多.

 

目录
相关文章
|
存储 自然语言处理 前端开发
从零写一个Recoil(翻译)
Rewriting Recoil from scratchrecoil是facebook编写的一个库,它之所以诞生是因为人体工程学、context的性能问题和useState。这是一个非常聪明的库,几乎每个人都会找到它的用途——如果你想了解更多,请查看这段解释视频。刚开始我被图论和recoil惊到了,但渐渐的理解后,感觉也没那么特别了。也许我也可以实现一个类似的东西。我自己实现的版本和recoil
192 0
从零写一个Recoil(翻译)
《Wir wilden weisen Frauen》翻译——<连载>
上周去逛图书馆,借了本德语原版的书。今天突然想起来了,就翻开来看。我不知道这本书是否有中文版的,不管有没有吧,我尝试翻译一下以提高自身的德语水平。每天花上一个半小时来翻译,我想应该不能翻译出来几句的。
764 0
|
Java iOS开发 Spring