Latest 0.2.0
Homepage https://github.com/pixio/PXImageView
License MIT
Platforms ios 7.0, requires ARC
Dependencies UIImageView_AFNetworking-Blocks
Frameworks UIKit
Authors

Version
License
Platform

Usage

Use it just like a normal UIImageView. The functional difference is the content modes.

PXImageView provides content modes that are likely more useful for you than what apple provides. It preserves the staples:

  • UIViewContentModeScaleAspectFit -> PXContentModeFit
  • UIViewContentModeScaleAspectFill -> PXContentModeFill

as well as providing several very useful ones (note in all these images, the blue imageview is resizing, not zooming):

  • PXContentModeTop:
    Scale the image keeping it attached to the top, right, and left edges.
    The bottom edge is free to move up and down as the image and view aspect
    ratios dictate.
    PXContentModeTop

  • PXContentModeLeft:
    Scale the image keeping it attached to the left, top, and bottom edges.
    The right edge is free to move sideways as the image and view aspect
    ratios dictate.
    PXContentModeLeft

  • PXContentModeRight:
    Scale the image keeping it attached to the right, top, and bottom edges.
    The left edge is free to move sideways as the image and view aspect
    ratios dictate.
    PXContentModeRight

  • PXContentModeBottom:
    Scale the image keeping it attached to the bottom, right, and left edges.
    The top edge is free to move up and down as the image and view aspect
    ratios dictate.
    PXContentModeBottom

  • PXContentModeSides:
    Scale the image keeping it centered and attached to the right and left edges.
    The top and bottom edges move up and down depending on the image and view
    aspect ratios.
    PXContentModeSides

  • PXContentModeTopBottom:
    Scale the image keeping it centered and attached to the top and bottom edges.
    The left and right edges move side to side depending on the image and view
    aspect ratios.
    PXContentModeTopBottom

To run the example project and see all these content modes in action, clone the repo, and run pod install from the Example directory first.

Installation

PXImageView is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "PXImageView"

Author

Daniel Blakemore, [email protected]

License

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

Latest podspec

{
    "name": "PXImageView",
    "version": "0.2.0",
    "summary": "An image view with more expressive content modes",
    "description": "An imageview with better content modes like Top which means fit and align to top.",
    "homepage": "https://github.com/pixio/PXImageView",
    "license": "MIT",
    "authors": {
        "Daniel Blakemore": "[email protected]"
    },
    "source": {
        "git": "https://github.com/pixio/PXImageView.git",
        "tag": "0.2.0"
    },
    "platforms": {
        "ios": "7.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*",
    "public_header_files": "Pod/Classes/**/*.h",
    "frameworks": "UIKit",
    "dependencies": {
        "UIImageView_AFNetworking-Blocks": []
    }
}

Pin It on Pinterest

Share This