JXCategoryTitleImageView.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //
  2. // JXCategoryTitleImageView.h
  3. // JXCategoryView
  4. //
  5. // Created by jiaxin on 2018/8/8.
  6. // Copyright © 2018年 jiaxin. All rights reserved.
  7. //
  8. #import "JXCategoryTitleView.h"
  9. #import "JXCategoryTitleImageCell.h"
  10. #import "JXCategoryTitleImageCellModel.h"
  11. @interface JXCategoryTitleImageView : JXCategoryTitleView
  12. //imageInfo数组可以传入imageName字符串或者image的URL地址等,然后会通过loadImageBlock透传回来,把imageView对于图片的加载过程完全交给使用者决定。
  13. @property (nonatomic, strong) NSArray <id>*imageInfoArray;
  14. @property (nonatomic, strong) NSArray <id>*selectedImageInfoArray;
  15. @property (nonatomic, copy) void(^loadImageBlock)(UIImageView *imageView, id info);
  16. //图片尺寸。默认CGSizeMake(20, 20)
  17. @property (nonatomic, assign) CGSize imageSize;
  18. //titleLabel和ImageView的间距,默认5
  19. @property (nonatomic, assign) CGFloat titleImageSpacing;
  20. //图片是否缩放。默认为NO
  21. @property (nonatomic, assign, getter=isImageZoomEnabled) BOOL imageZoomEnabled;
  22. //图片缩放的最大scale。默认1.2,imageZoomEnabled为YES才生效
  23. @property (nonatomic, assign) CGFloat imageZoomScale;
  24. //默认@[JXCategoryTitleImageType_LeftImage...]
  25. @property (nonatomic, strong) NSArray <NSNumber *> *imageTypes;
  26. //下面的属性将会被弃用,请使用`imageInfoArray`、`selectedImageInfoArray`、`loadImageBlock`属性完成需求。
  27. //普通状态下的imageNames,通过[UIImage imageNamed:]方法加载
  28. @property (nonatomic, strong) NSArray <NSString *>*imageNames;
  29. //选中状态下的imageNames,通过[UIImage imageNamed:]方法加载。可选
  30. @property (nonatomic, strong) NSArray <NSString *>*selectedImageNames;
  31. //普通状态下的imageURLs,通过loadImageCallback回调加载
  32. @property (nonatomic, strong) NSArray <NSURL *>*imageURLs;
  33. //选中状态下的selectedImageURLs,通过loadImageCallback回调加载
  34. @property (nonatomic, strong) NSArray <NSURL *>*selectedImageURLs;
  35. //使用imageURL从远端下载图片进行加载,建议使用SDWebImage等第三方库进行下载。
  36. @property (nonatomic, copy) void(^loadImageCallback)(UIImageView *imageView, NSURL *imageURL);
  37. @end