HBImageScroller.h 993 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. //
  2. // HBImageScroller.h
  3. // MyTest
  4. //
  5. // Created by weqia on 13-7-31.
  6. // Copyright (c) 2013年 weqia. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. @interface HBImageScroller : UIScrollView
  10. {
  11. UIImageView * _imageView;
  12. BOOL max;
  13. id _target;
  14. SEL _tapOnceAction;
  15. CGSize _beginSize;
  16. CGSize _beginImageSize;
  17. float _scale;
  18. float _imgScale;
  19. }
  20. @property(nonatomic,readonly) UIImageView * imageView;
  21. @property(nonatomic,assign) UIViewController * controller;
  22. -(id)initWithImage:(UIImage*)image andFrame:(CGRect)frame; // 根据图片,frame初始化
  23. -(void) addTarget:(id)target tapOnceAction:(SEL)action; //添加单击事件的委托方法
  24. -(void)setImage:(UIImage*)image;
  25. -(void)setImageWithURL:(NSString*)url andSmallImage:(UIImage*)image;
  26. -(void)setImageWithURL:(NSString *)url ;
  27. -(void)reset; //还原
  28. @end
  29. typedef enum {
  30. RegionTopLeft=0,
  31. RegionBottomLeft,
  32. RegionTopRight,
  33. RegionBottomRight
  34. } LocationRegion;