线上所有马甲包模板,与《猎豆》同UI。域名zhuadd

MLTextAttachment.h 1.1KB

123456789101112131415161718192021222324252627282930313233
  1. //
  2. // MLTextAttachment.h
  3. // MLLabel
  4. //
  5. // Created by molon on 15/6/11.
  6. // Copyright (c) 2015年 molon. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. @interface MLTextAttachment : NSTextAttachment
  10. @property (readonly, nonatomic, assign) CGFloat width;
  11. @property (readonly, nonatomic, assign) CGFloat height;
  12. /**
  13. * 优先级比上面的高,以lineHeight为根据来决定高度
  14. * 宽度根据imageAspectRatio来定
  15. */
  16. @property (readonly, nonatomic, assign) CGFloat lineHeightMultiple;
  17. /**
  18. * image.size.width/image.size.height
  19. */
  20. @property (readonly, nonatomic, assign) CGFloat imageAspectRatio;
  21. + (instancetype)textAttachmentWithWidth:(CGFloat)width height:(CGFloat)height imageBlock:(UIImage * (^)(CGRect imageBounds,NSTextContainer *textContainer,NSUInteger charIndex,MLTextAttachment *textAttachment))imageBlock;
  22. + (instancetype)textAttachmentWithLineHeightMultiple:(CGFloat)lineHeightMultiple imageBlock:(UIImage * (^)(CGRect imageBounds,NSTextContainer *textContainer,NSUInteger charIndex,MLTextAttachment *textAttachment))imageBlock
  23. imageAspectRatio:(CGFloat)imageAspectRatio;
  24. @end