FrontPage > Apple > iOS開発メモ > Cocoa Touch Layer(UIKit) > UIView
Initializes and returns a newly allocated view object with the specified frame rectangle.
- (id)initWithFrame:(CGRect)frame;
@property(nonatomic, getter=isUserInteractionEnabled) BOOL userInteractionEnabled
@property(nonatomic) CGRect frame
The receiver’s bounds rectangle, which expresses its location and size in its own coordinate system.
@property(nonatomic) CGRect bounds
The center of the frame.
@property(nonatomic) CGPoint center
Specifies the transform applied to the receiver, relative to the center of its bounds.
@property(nonatomic) CGAffineTransform transform
The receiver’s superview, or nil if it has none. (read-only)
@property(nonatomic, readonly) UIView *superview
The receiver’s immediate subviews. (read-only)
@property(nonatomic, readonly, copy) NSArray *subviews
The receiver’s window object, or nil if it has none. (read-only)
@property(nonatomic, readonly) UIWindow *window
コンテンツ(UIView、UIViewサブクラス)を追加する。(表示設定用処理)
- (void)addSubview:(UIView *)view;
Moves the specified subview to the front of its siblings.
- (void)bringSubviewToFront:(UIView *)view;
Moves the specified subview to the back of its siblings.
- (void)sendSubviewToBack:(UIView *)view;
Unlinks the receiver from its superview and its window, and removes it from the responder chain.
- (void)removeFromSuperview;
Inserts a subview at the specified index.
- (void)insertSubview:(UIView *)view atIndex:(NSInteger)index;
Inserts a view above another view in the view hierarchy.
- (void)insertSubview:(UIView *)view aboveSubview:(UIView *)siblingSubview;
Inserts a view below another view in the view hierarchy.
- (void)insertSubview:(UIView *)view belowSubview:(UIView *)siblingSubview;
Exchanges the subviews in the receiver at the given indices.
- (void)exchangeSubviewAtIndex:(NSInteger)index1 withSubviewAtIndex:(NSInteger)index2;
Returns a Boolean value indicating whether the receiver is a subview of a given view or whether it is identical to that view.
- (BOOL)isDescendantOfView:(UIView *)view;
Converts a point from the receiver’s coordinate system to that of a given view.
- (CGPoint)convertPoint:(CGPoint)point toView:(UIView *)view;
Converts a point from the coordinate system of a given view to that of the receiver.
- (CGPoint)convertPoint:(CGPoint)point fromView:(UIView *)view;
Converts a rectangle from the receiver’s coordinate system to that of another view.
- (CGRect)convertRect:(CGRect)rect toView:(UIView *)view;
Converts a rectangle from the coordinate system of another view to that of the receiver.
- (CGRect)convertRect:(CGRect)rect fromView:(UIView *)view;
The scale factor applied to the view.
@property(nonatomic) CGFloat contentScaleFactor
A Boolean value that determines whether the receiver automatically resizes its subviews when its frame size changes.
@property(nonatomic) BOOL autoresizesSubviews
An integer bit mask that determines how the receiver resizes itself when its bounds change.
@property(nonatomic) UIViewAutoresizing autoresizingMask
Asks the view to calculate and return the size that best fits its subviews.
- (CGSize)sizeThatFits:(CGSize)size;
Resizes and moves the receiver view so it just encloses its subviews.
- (void)sizeToFit;
A flag used to determine how a view lays out its content when its bounds rectangle changes.
@property(nonatomic) UIViewContentMode contentMode
The rectangle that defines the stretchable and nonstretchable regions of a view.
@property(nonatomic) CGRect contentStretch
The receiver’s tag, an integer that you can use to identify view objects in your application.
@property(nonatomic) NSInteger tag
Returns the view with the specified tag.
- (UIView *)viewWithTag:(NSInteger)tag;
Sets whether subviews need to be rearranged before displaying.
- (void)setNeedsLayout;
Lays out the subviews if needed.
- (void)layoutIfNeeded;
Lays out subviews.
- (void)layoutSubviews;
A Boolean value that determines whether subviews can be drawn outside the bounds of the receiver.
@property(nonatomic) BOOL clipsToBounds
The receiver’s background color.
@property(nonatomic, copy) UIColor *backgroundColor
The receiver’s alpha value.
@property(nonatomic) CGFloat alpha
A Boolean value that determines whether the receiver is opaque.
@property(nonatomic, getter=isOpaque) BOOL opaque
A Boolean value that determines whether the receiver’s bounds should be automatically cleared before drawing.
@property(nonatomic) BOOL clearsContextBeforeDrawing
Draws the receiver’s image within the passed-in rectangle.
- (void)drawRect:(CGRect)rect;
Controls whether the receiver's entire bounds rectangle is marked as needing display.
- (void)setNeedsDisplay;
Marks the region of the receiver within the specified rectangle as needing display, increasing the receiver’s existing invalid region to include it.
- (void)setNeedsDisplayInRect:(CGRect)rect;
Returns the class used to create the layer for instances of this class.
+ (Class)layerClass;
The view’s Core Animation layer used for rendering. (read-only)
@property(nonatomic, readonly, retain) CALayer *layer
A Boolean value that determines whether the receiver is hidden.
@property(nonatomic, getter=isHidden) BOOL hidden
Animate changes to one or more views using the specified duration.
+ (void)animateWithDuration:(NSTimeInterval)duration animations:(void (^)(void))animations
Animate changes to one or more views using the specified duration and completion handler.
+ (void)animateWithDuration:(NSTimeInterval)duration animations:(void (^)(void))animations completion:(void (^)(BOOL finished))completion
Animate changes to one or more views using the specified duration, delay, options, and completion handler.
+ (void)animateWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay options:(UIViewAnimationOptions)options animations:(void (^)(void))animations
completion:(void (^)(BOOL finished))completion
+ (void)transitionWithView:(UIView *)view duration:(NSTimeInterval)duration options:(UIViewAnimationOptions)options animations:(void (^)(void))animations completion:(void (^)(BOOL finished))completion __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_4_0);
+ (void)transitionFromView:(UIView *)fromView toView:(UIView *)toView duration:(NSTimeInterval)duration options:(UIViewAnimationOptions)options completion:(void (^)(BOOL finished))completion __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_4_0);
beginAnimations
+ (void)beginAnimations:(NSString *)animationID context:(void *)context
+ (void)commitAnimations;
+ (void)setAnimationStartDate:(NSDate *)startDate;
+ (void)setAnimationsEnabled:(BOOL)enabled;
+ (void)setAnimationDelegate:(id)delegate;
+ (void)setAnimationWillStartSelector:(SEL)selector;
+ (void)setAnimationDidStopSelector:(SEL)selector;
+ (void)setAnimationDuration:(NSTimeInterval)duration;
+ (void)setAnimationDelay:(NSTimeInterval)delay;
+ (void)setAnimationCurve:(UIViewAnimationCurve)curve;
+ (void)setAnimationRepeatCount:(float)repeatCount;
+ (void)setAnimationRepeatAutoreverses:(BOOL)repeatAutoreverses;
+ (void)setAnimationBeginsFromCurrentState:(BOOL)fromCurrentState;
+ setAnimationTransition:forView:cache:+ (void)setAnimationTransition:(UIViewAnimationTransition)transition forView:(UIView *)view cache:(BOOL)cache;
+ (BOOL)areAnimationsEnabled;
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event;
- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event;
multipleTouchEnabled property
exclusiveTouch property
- endEditing:
- (void)addGestureRecognizer:(UIGestureRecognizer*)gestureRecognizer __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_2);
- (void)removeGestureRecognizer:(UIGestureRecognizer*)gestureRecognizer __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_2);
gestureRecognizers property
- (void)didAddSubview:(UIView *)subview;
- (void)didMoveToSuperview;
- (void)didMoveToWindow;
- (void)willMoveToSuperview:(UIView *)newSuperview;
- (void)willMoveToWindow:(UIWindow *)newWindow;
- (void)willRemoveSubview:(UIView *)subview;