码迷,mamicode.com
首页 > 移动开发 > 详细

学习IOS开发UI篇--UI知识点总结(二) UILabel/UIImageView

时间:2014-06-02 00:03:51      阅读:432      评论:0      收藏:0      [点我收藏+]

标签:des   c   style   a   ext   color   

  UILabel:常用属性

@property(nonatomic,copy)   NSString           *text;            // default is nil

@property(nonatomic,retain) UIFont             *font;            // default is nil (system font 17 plain)

@property(nonatomic,retain) UIColor            *textColor;

@property(nonatomic)        NSTextAlignment    textAlignment;   // default is NSTextAlignmentLeft

@property(nonatomic,getter=isUserInteractionEnabled) BOOL userInteractionEnabled;  // default is NO

@property(nonatomic,getter=isEnabled)                BOOL enabled;                 // default is YES. changes how the label is drawn

@property(nonatomic) NSInteger numberOfLines; (设置为0不限制行数)

 

  设置宽高,自动换行,NSString类的对象方法,配合使用

- (CGRect)boundingRectWithSize:(CGSize)size options:(NSStringDrawingOptions)options attributes:(NSDictionary *)attributes context:(NSStringDrawingContext *)context NS_AVAILABLE_IOS(7_0);

options 设置为NSStringDrawingUsesLineFragmentOrigin

attributes 设置为 @{NSFontAttributeName :[UIFont systemFontOfSize:15]}

context 设置为nil;

  UIImageView:常用属性,注意动画效果

@property(nonatomic,copy) NSArray *animationImages;            // The array must contain UIImages. Setting hides the single image. default is nil

@property(nonatomic,copy) NSArray *highlightedAnimationImages NS_AVAILABLE_IOS(3_0);            // The array must contain UIImages. Setting hides the single image. default is nil

@property(nonatomic) NSTimeInterval animationDuration;         // for one cycle of images. default is number of images * 1/30th of a second (i.e. 30 fps)

@property(nonatomic) NSInteger      animationRepeatCount;      // 0 means infinite (default is 0)

  动画完成后清空数组

- (void)performSelector:(SEL)aSelector withObject:(id)anArgument afterDelay:(NSTimeInterval)delay;

学习IOS开发UI篇--UI知识点总结(二) UILabel/UIImageView,布布扣,bubuko.com

学习IOS开发UI篇--UI知识点总结(二) UILabel/UIImageView

标签:des   c   style   a   ext   color   

原文地址:http://www.cnblogs.com/zhaoyan/p/3763283.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!