Latest 1.0.3
Homepage https://github.com/Jiar/UIImageView-AutoAdapter
License MIT
Platforms ios 7.0, requires ARC
Authors

UIImageView-AutoAdapter


What’s the UIImageView-AutoAdapter

在实际的开发项目中,经常遇到UIImageViewUIImage的大小无法适配的情况,使得显示的图片以拉伸、压缩、旁边留白等形式显示,效果很不理想。UIImageView-AutoAdapter正是为了解决这个问题出现的,实现自动适配UIImage,使得图片以正常的宽高比显示,无拉伸缩放等影响。
UIImageView-AutoAdapter show
上图由两部分组成,左边为xib中图片的显示形式,右边为实际在真机上图片的显示形式。在左边的显示效果中我们可以看到,图片以拉伸或是压缩的形式显示,而右边的显示效果中,图片以理想的效果显示。

最后一张图片由于我在代码中设置了关闭了使用UIImageView-AutoAdapter,因此两边最后一张图片的显示效果一样。

由此可见,使用UIImageView-AutoAdapter即可轻松解决图片适应问题。

How To Get Started

Installation with CocoaPods

$ gem install cocoapods

Podfile

platform :ios, '7.0'
pod "UIImageView-AutoAdapter"

如果CocoaPods中无法搜索到UIImageView-AutoAdapter,先尝试使用pod repo update --verbose更新下CocoaPods

Usage

UIImageView-AutoAdapter使用了runtime黑魔法,你不需要进行任何额外的调用就可以直接使用。当然,如果你想让某个UIImageView不使用UIImageView-AutoAdapter,你可以用如下方式为这个UIImageView关闭使用UIImageView-AutoAdapter

#import "KeyboardToolBar.h"

// imageView是UIImageView的实例对象
[imageView setCloseAdapter:YES];

License

UIImageView-AutoAdapter使用了MIT开源协议。

Latest podspec

{
    "name": "UIImageView-AutoAdapter",
    "version": "1.0.3",
    "summary": "UIImage automatically adapt to UIImageView.",
    "description": "A longer description of UIImageView-AutoAdapter in Markdown format.nn* Think: Why did you write this? What is the focus? What does it do?n* CocoaPods will be using this to generate tags, and improve search results.n* Try to keep it short, snappy and to the point.n* Finally, don't worry about the indent, CocoaPods strips it!",
    "homepage": "https://github.com/Jiar/UIImageView-AutoAdapter",
    "license": "MIT",
    "authors": {
        "Jiar": "[email protected]"
    },
    "platforms": {
        "ios": "7.0"
    },
    "source": {
        "git": "https://github.com/Jiar/UIImageView-AutoAdapter.git",
        "tag": "1.0.3"
    },
    "source_files": [
        "Classes",
        "Classes/**/*.{h,m}"
    ],
    "requires_arc": true
}

Pin It on Pinterest

Share This