首页 > 代码库 > UIView的常用方法

UIView的常用方法

UIView : UIResponder <NSCoding, UIAppearance, UIAppearanceContainer, UIDynamicItem, UITraitEnvironment, UICoordinateSpace>

+ (Class)layerClass; 

- (instancetype)initWithFrame:(CGRect)frame; 

//是否可点击

@property(nonatomic,getter=isUserInteractionEnabled) BOOL userInteractionEnabled;  

 @property(nonatomic,readonly,retain)                 CALayer  *layer; 

 

@interface UIView(UIViewGeometry)

//仿射变化

@property(nonatomic) CGAffineTransform transform; 

@property(nonatomic) CGFloat           contentScaleFactor NS_AVAILABLE_IOS(4_0);

@property(nonatomic,getter=isMultipleTouchEnabled) BOOL multipleTouchEnabled;

@property(nonatomic,getter=isExclusiveTouch) BOOL       exclusiveTouch; 

- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event; 

- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event; 

 

- (CGPoint)convertPoint:(CGPoint)point toView:(UIView *)view;

- (CGPoint)convertPoint:(CGPoint)point fromView:(UIView *)view;

- (CGRect)convertRect:(CGRect)rect toView:(UIView *)view;

- (CGRect)convertRect:(CGRect)rect fromView:(UIView *)view;

 

@property(nonatomic) BOOL               autoresizesSubviews;

@property(nonatomic) UIViewAutoresizing autoresizingMask; 

- (CGSize)sizeThatFits:(CGSize)size;   

- (void)sizeToFit;  

 

 

 

 

UIView的常用方法