Skip to content

`PXImageView` provides content modes that are likely more useful for you than what Apple provides

License

Notifications You must be signed in to change notification settings

pixio/PXImageView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PXImageView

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, DanBlakemore@gmail.com

License

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

About

`PXImageView` provides content modes that are likely more useful for you than what Apple provides

Resources

License

Stars

Watchers

Forks

Packages

No packages published