標籤: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;