The protocols that UIView inherits from UIResponder
include NSCoding, UIAppearance, UIAppearanceContainer,
UIDynamicItem, and NSObject
. We can see that the UIView class can respond to gestures
. So let's start this journey
with its properties. Properties
@ property(nonatomic) CGFloat alpha
//Set the transparency of the view
//The transparency is set from the minimum 0.0 to 1.0, 1.0 is completely opaque,
//This property only affects the current view, and will not affect its subviews
@property(nonatomic, getter=isOpaque) BOOL opaque
//Determine whether the current view is transparent
@property(nonatomic) BOOL autoresizesSubviews
//This property is to determine whether the subview will also be automatically resized when the view size boundary changes
@property(nonatomic) UIViewAutoresizing autoresizingMask
//Decide how to adjust the size of the current view when the size of the parent view of the current view changes
@property(nonatomic, copy) UIColor *backgroundColor //background color of the current view
@property(nonatomic) CGRect bounds //bounds of the current view, including size and origin, here is @property(nonatomic) CGRect frame
in the system coordinate system //The boundary of the current view, including size and origin, here is in the coordinate system of the parent view @property(nonatomic) CGPoint center //The center of the current view, and specify that it is in the coordinate system of the parent view @property(nonatomic) BOOL clearsContextBeforeDrawing //Determine whether to clear the previous content of the view before the view is redrawn, the default value is YES //If you set this property to NO, then you must ensure that you can draw correctly in the drawRect: method. If your code // has done a lot of optimization, then setting it to NO can improve performance, especially when scrolling may only need to repaint part of the view @property(nonatomic) BOOL clipsToBounds // Determine whether the subview is bound to the current In the bounds of the view, the default value is NO @property(nonatomic) UIViewContentMode contentMode //Determine how the view content is rendered when the view boundary changes @property(nonatomic) CGFloat contentScaleFactor
//Scale Scale applied to the current view
@property(nonatomic, getter=isExclusiveTouch) BOOL exclusiveTouch
//Determines whether the current view is the only object that handles touch events
@property(nonatomic, copy) NSArray *gestureRecognizers
//The current view is attached Gesture recognizer
@property(nonatomic, getter=isHidden) BOOL hidden
//Whether the current view is hidden
@property(nonatomic, readonly, retain) CALayer *layer
//Core animation layer for view rendering
@property(copy, nonatomic) NSArray *motionEffects
//The motion effect of the current view, IOS7 started to have
@property(nonatomic, getter=isMultipleTouchEnabled) BOOL multipleTouchEnabled
//Whether the current view accepts multi-touch events, the default value is NO
@property(nonatomic, copy) NSString *restorationIdentifier
//This identifier determines whether the view supports the restoration state. In fact, it is just an identifier.
//Personally, it is equivalent to the identifier used when configuring each cell of the table view, and it can be reused directly in memory. improved performance
//One more thing to note, this identifier should not be simply defined, because the view controller it belongs to, and the view controller's
//all parent view controllers must have a restore identifier
@property(nonatomic, readonly, copy ) NSArray *subviews //All subviews of the current view
@property(nonatomic, readonly) UIView *superview //The parent view of the current view
@property(nonatomic) NSInteger tag //The label of the current view
@property(nonatomic) UIViewTintAdjustmentMode tintAdjustmentMode
/ /Tone adjustment mode, starting for IOS7
@property(nonatomic, retain) UIColor *tintColor
//Tint color, starting for IOS7
@property(nonatomic) CGAffineTransform transform //Affine transformation of the view
@property(nonatomic, getter=isUserInteractionEnabled ) BOOL userInteractionEnabled
//Determine whether user interaction events are ignored and removed from the event queue
@property(nonatomic, readonly) UIWindow *window //The UIWindow object on the current view
[Turn] IOS UIView Properties
Guess you like
Origin http://43.154.161.224:23101/article/api/json?id=326352622&siteId=291194637
Ranking