UIView方法,属性的集合

@interface UIView : UIResponder<NSCoding, UIAppearance, UIAppearanceContainer, UIDynamicItem>

/**
 *  通过一个frame来初始化一个UI控件
 */
- (id)initWithFrame:(CGRect)frame;

// YES:能够跟用户进行交互
@property(nonatomic,getter=isUserInteractionEnabled) BOOL userInteractionEnabled;  // default is YES

// 控件的一个标记(父控件可以通过tag找到对应的子控件)
@property(nonatomic)                                 NSInteger tag;                // default is 0

// 图层(可以用来设置圆角效果\阴影效果)
@property(nonatomic,readonly,retain)                 CALayer  *layer;

@end

@interface UIView(UIViewGeometry)
// 位置和尺寸(以父控件的左上角为坐标原点(0, 0))
@property(nonatomic) CGRect            frame;

// 位置和尺寸(以自己的左上角为坐标原点(0, 0))
@property(nonatomic) CGRect            bounds;

// 中点(以父控件的左上角为坐标原点(0, 0))
@property(nonatomic) CGPoint           center;      

// 形变属性(平移\缩放\旋转)
@property(nonatomic) CGAffineTransform transform;   // default is CGAffineTransformIdentity

// YES:支持多点触摸
@property(nonatomic,getter=isMultipleTouchEnabled) BOOL multipleTouchEnabled;   // default is NO
@end

@interface UIView(UIViewHierarchy)
// 父控件
@property(nonatomic,readonly) UIView       *superview;

// 子控件(新添加的控件默认都在subviews数组的后面, 新添加的控件默认都显示在最上面\最顶部)
@property(nonatomic,readonly,copy) NSArray *subviews;

// 获得当前控件所在的window
@property(nonatomic,readonly) UIWindow     *window;

// 从父控件中移除一个控件
- (void)removeFromSuperview;

// 添加一个子控件(可以将子控件插入到subviews数组中index这个位置)
- (void)insertSubview:(UIView *)view atIndex:(NSInteger)index;

// 交换subviews数组中所存放子控件的位置
- (void)exchangeSubviewAtIndex:(NSInteger)index1 withSubviewAtIndex:(NSInteger)index2;

// 添加一个子控件(新添加的控件默认都在subviews数组的后面, 新添加的控件默认都显示在最上面\最顶部)
- (void)addSubview:(UIView *)view;

// 添加一个子控件view(被挡在siblingSubview的下面)
- (void)insertSubview:(UIView *)view belowSubview:(UIView *)siblingSubview;

// 添加一个子控件view(盖在siblingSubview的上面)
- (void)insertSubview:(UIView *)view aboveSubview:(UIView *)siblingSubview;

// 将某个子控件拉到最上面(最顶部)来显示
- (void)bringSubviewToFront:(UIView *)view;

// 将某个子控件拉到最下面(最底部)来显示
- (void)sendSubviewToBack:(UIView *)view;

/**系统自动调用(留给子类去实现)**/
- (void)didAddSubview:(UIView *)subview;
- (void)willRemoveSubview:(UIView *)subview;

- (void)willMoveToSuperview:(UIView *)newSuperview;
- (void)didMoveToSuperview;
- (void)willMoveToWindow:(UIWindow *)newWindow;
- (void)didMoveToWindow;
/**系统自动调用**/

// 是不是view的子控件或者子控件的子控件(是否为view的后代)
- (BOOL)isDescendantOfView:(UIView *)view;  // returns YES for self.

// 通过tag获得对应的子控件(也可以或者子控件的子控件)
- (UIView *)viewWithTag:(NSInteger)tag;     // recursive search. includes self

/**系统自动调用(留给子类去实现)**/
// 控件的frame发生改变的时候就会调用,一般在这里重写布局子控件的位置和尺寸
// 重写了这个写方法后,一定调用[super layoutSubviews];
- (void)layoutSubviews;

@end

@interface UIView(UIViewRendering)
// YES : 超出控件边框范围的内容都剪掉
@property(nonatomic)                 BOOL              clipsToBounds;

// 背景色
@property(nonatomic,copy)            UIColor          *backgroundColor; // default is nil

// 透明度(0.0~1.0)
@property(nonatomic)                 CGFloat           alpha;                      // default is 1.0

// YES:不透明  NO:透明
@property(nonatomic,getter=isOpaque) BOOL              opaque;                     // default is YES

// YES : 隐藏  NO : 显示
@property(nonatomic,getter=isHidden) BOOL              hidden;

// 内容模式
@property(nonatomic)                 UIViewContentMode contentMode;                // default is UIViewContentModeScaleToFill
@end

@interface UIView(UIViewAnimationWithBlocks)
+ (void)animateWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay options:(UIViewAnimationOptions)options animations:(void (^)(void))animations completion:(void (^)(BOOL finished))completion;
+ (void)animateWithDuration:(NSTimeInterval)duration animations:(void (^)(void))animations completion:(void (^)(BOOL finished))completion;

+ (void)animateWithDuration:(NSTimeInterval)duration animations:(void (^)(void))animations;
+ (void)animateWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay usingSpringWithDamping:(CGFloat)dampingRatio initialSpringVelocity:(CGFloat)velocity options:(UIViewAnimationOptions)options animations:(void (^)(void))animations completion:(void (^)(BOOL finished))completion;
@end
时间: 2024-08-03 06:38:43

UIView方法,属性的集合的相关文章

iPone应用开发 UIView 常用属性和方法

iPone应用程序开发 UIView常用属性和方法 常用属性 alpha 视图的透明度0.0f - 1.0f backgroundColor 视图的背景颜色 subviews 子视图的集合 hidden 视图是否隐藏 tag 视图的唯一标示符,是一个整形数据 superview 视图的父视图 multipleTouchEnabled 是否开启多点触控 userInteractionEnable 是否响应触摸事件 常用方法 - (void)removeFromSuperview; //从父视图中删

UIView常用属性与方法/UIKit继承结构

UIView常用属性与方法 @interface UIView : UIResponder<NSCoding, UIAppearance, UIAppearanceContainer, UIDynamicItem> /** * 通过一个frame来初始化一个UI控件 */ - (id)initWithFrame:(CGRect)frame; // YES:能够跟用户进行交互 @property(nonatomic,getter=isUserInteractionEnabled) BOOL us

使用jQuery异步传递含复杂属性及集合属性的Model到控制器方法

Student类有集合属性Courses,如何把Student连同集合属性Courses传递给控制器方法? public class Student     {         public string StudentName { get; set; }         public IList<Course> Courses { get; set; }     } public class Course     {         public string CourseName { ge

【JVM虚拟机】(8)--深入理解Class中--方法、属性表集合

#[JVM虚拟机](8)--深入理解Class中--方法.属性表集合 之前有关class文件已经写了两篇博客: 1.[JVM虚拟机](5)---深入理解JVM-Class中常量池 2.[JVM虚拟机](6)---深入理解Class中访问标志.类索引.父类索引.接口索引 3.[JVM虚拟机](7)---深入理解Class中-属性集合 那么这篇博客主要讲有关 方法表集合 相关的理解和代码示例. 方法表集合: 告知该方法是什么修饰符修饰?是否有方法值?返回类型是什么?方法名称,方法参数,还有就是方法内

jQuery中一些不常用的方法属性【转载】

index(subject) 搜索与参数表示的对象匹配的元素,并返回相应元素的索引值.如果找到了匹配的元素,从0开始返回:如果没有找到匹配的元素,返回-1. data() data(elem):为页面对象添加唯一标识. data(name, value):将数据保存在元素的一个key里面.$("#box").data("shape","rectangle"). data(name):获取值.$("#box").data(&qu

XStream--&gt;别名;元素转属性;去除集合属性(剥皮);忽略不需要元素

--->清单: City.java Province.java TestXStream.java 4个XStream方法的效果图 javabean-->City.java 1 package xstream; 2 3 public class City { 4 private String name; 5 private String description; 6 7 public String getName() { 8 return name; 9 } 10 public void set

简述UIView的属性和用法

1.alpha 设置视图的透明度.默认为1. // 完全透明 view.alpha = 0; // 不透明 view.alpha = 1; 2.clipsToBounds // 默认是NO,当设置为yes时,超出当前视图的尺寸的内容和子视图不会显示. view.clipsToBounds = YES; 3.hidden // 默认是NO,当设置为yes,视图就看不见了. view.hidden = YES; 4.userInteractionEnabled // 默认为YES,如果设置为No,v

UIView 常见属性

UIView 常见属性 UIView 常见属性 NSArray *subviews 获取所有的子控件(前提必须是加载在该视图上) 数组的顺序决定着子控件的显示层级顺序(下标越大的,越显示在上面) UIView的常见方法 addSubview 添加一个子控件 使用这个方法添加的子控件会被塞到subViews数组的最后面 可以使用下面的方法调整子控件在subViews数组中的顺序 //将子控件view插入到subviews数组的index位置 -(void)insertSubview:(UIView

深入理解Java虚拟机笔记---属性表集合

在Class文件,字段表,方法表中都可以携带自己的属性表集合,以用于描述某些场景专有的信息.与Class文件中其它的数据项目要求的顺序.长度和内容不同,属性表集合的限制稍微宽松一些,不再要求各个属性表具有严格的顺序,并且只要不与已有的属性名重复,任何人实现的编译器都可以向属性表中写入自己定义的属性信息,Java虚拟机运行时会忽略掉它不认识的属性.为了能正确地解析Class文件,<Java虚拟机规范(第二版)>中预定义了9荐虚拟机实现应当能识别的属性,具体如下表所示: 对于每个属性,它的名称需要