AttributedLabel.h 856 B

1234567891011121314151617181920212223242526272829303132
  1. //
  2. // AttributedLabel.h
  3. // AttributedStringTest
  4. //
  5. // Created by sun huayu on 13-2-19.
  6. // Copyright (c) 2013年 sun huayu. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. #import <CoreText/CoreText.h>
  10. #import <QuartzCore/QuartzCore.h>
  11. @interface AttributedLabel : UILabel{
  12. NSMutableAttributedString *_attString;
  13. }
  14. @property (nonatomic,retain)NSMutableAttributedString *attString;
  15. - (id)initWithFrame:(CGRect)frame strikethroughPosition:(CGRect) _strikeRect;
  16. // 设置某段字的颜色
  17. - (void)setColor:(UIColor *)color fromIndex:(NSInteger)location length:(NSInteger)length;
  18. // 设置某段字的字体
  19. - (void)setFont:(UIFont *)font fromIndex:(NSInteger)location length:(NSInteger)length;
  20. // 设置某段字的风格
  21. - (void)setStyle:(CTUnderlineStyle)style fromIndex:(NSInteger)location length:(NSInteger)length;
  22. @end