Tag Archive for 'imageview'

iPhone – transparent imageview tint

Drop-in solution for a tintable/blendable “imageview”:

The .h file:

#import <UIKit/UIKit.h>

@interface UIBlendableImageView : UIView

- (id)initWithImage:(UIImage*)image andTintColor:(UIColor*)tintColor;

@end

The .m file:

#import "UIBlendableImageView.h"
#import <QuartzCore/QuartzCore.h>

@implementation UIBlendableImageView

- (id)initWithImage:(UIImage*)image andTintColor:(UIColor*)tintColor
{
    self = [super initWithFrame:CGRectMake(0, 0, image.size.width, image.size.height)];
    if (self) {
        UIImageView *maskImageView = [[[UIImageView alloc] initWithImage:image] autorelease];
        [maskImageView setFrame:[self bounds]];
        [[self layer] setMask:[maskImageView layer]];
        [self setBackgroundColor:tintColor];
    }
    return self;
}

@end

Android zoomable-pannable ImageView

PhotoView aims to help produce an easily usable implementation of a zooming Android ImageView.
Features

  • Out of the box zooming, using multi-touch and double-tap.
  • Scrolling, with smooth scrolling fling.
  • Works perfectly when using used in a scrolling parent (such as ViewPager).
  • Allows the application to be notified when the displayed Matrix has changed. Useful for when you need to update your UI based on the current zoom/scroll position.
  • Allows the application to be notified when the user taps on the Photo.
  • PhotoView GitHub site

    Easy shadow making around ImageView

    If you want a realistic, nice shadow around an image in an ImageView you might configure it with the following layout:

    Source with shadow image: Stackoverflow.com

    Note This solution works best with fitXY scaleType, it does not apply to aspect corrected images. (it can be done with custom Drawable object)

    Zoom-rotate image gallery with UIScrollView

    There is a great and easy solution to display an image gallery with zooming and panning option using the built-in zooming and autoresizing tools: Tutorial here