ios学习-UIView方法
2013-11-13 14:10
309 查看
UIView位置与尺寸: 1.initWithFrame:
2.frame属性和center属性
修改背景色: backgroundColor属性
设置透明色: alpha属性
UIView内容管理
内容的自动尺寸调整: contentMode属性
指定内容的伸缩区域: ContentStretch属性 (CGRect)
适应内容: sizeToFit方法
Affine变换: transform属性 (CGAffineTransform)
UIView嵌套
追加子元素: addSubView:
insertSubview:atIndex:
insertSubview:aboveSubview:
insertSubview:belowSubview:
删除子元素: removeFromSuperview:
交换子元素顺序: exchangeSubviewAtIndex:withSubviewAtIndex:
靠前显示: bringSubviewToFront:
靠后隐藏: sendSubviewToBack:
UIView的检索: viewWithTag:
UIView的外观
外观自动调整: 调用setNeedsLayout方法 自动调用 layoutSubViews
子元素自动尺寸调整: UIView的 autoresizeSubviews属性(YES/NO) autoresizingMask属性
( UIViewAutoresizingNone 无自动调整
UIViewAutoresizingFlexibleLeftMargin 调整左侧间距
UIViewAutoresizingFlexibleRightMargin 调整右侧间距
UIViewAutoresizingFlexibleTopMargin 调整顶部间距
UIViewAutoresizingFlexibleBottomMargin 调整底部间距
UIViewAutoresizingFlexibleWidth 调整宽度
UIViewAutoresizingFlexibleHeight 调整高度 )
坐标变换:
convertPoint:toView:
convertRect:toView:
convertPoint:fromView:
convertRect:fromView:
UIView的状态监视
UIView追加子元素后: - (void) didAddSubview: (UIView*) subview
UIView删除子元素前: - (void)willRemoveSubview: (UIView*) subview
UIView作为UIView子元素被追加/删除前: - (void)willMoveToSurperview:(UIView*)newSurperview
UIView作为UIView子元素被追加/删除后: - (void)didMobeToSurperview
UIView作为UIWindow子元素被追加/删除前: - (void)willMoveToWindow:(UIWindow*)newWindow
UIView作为UIWindow子元素被追加/删除后: -(void) didMoveToWindow
2.frame属性和center属性
修改背景色: backgroundColor属性
设置透明色: alpha属性
UIView内容管理
内容的自动尺寸调整: contentMode属性
指定内容的伸缩区域: ContentStretch属性 (CGRect)
适应内容: sizeToFit方法
Affine变换: transform属性 (CGAffineTransform)
UIView嵌套
追加子元素: addSubView:
insertSubview:atIndex:
insertSubview:aboveSubview:
insertSubview:belowSubview:
删除子元素: removeFromSuperview:
交换子元素顺序: exchangeSubviewAtIndex:withSubviewAtIndex:
靠前显示: bringSubviewToFront:
靠后隐藏: sendSubviewToBack:
UIView的检索: viewWithTag:
UIView的外观
外观自动调整: 调用setNeedsLayout方法 自动调用 layoutSubViews
子元素自动尺寸调整: UIView的 autoresizeSubviews属性(YES/NO) autoresizingMask属性
( UIViewAutoresizingNone 无自动调整
UIViewAutoresizingFlexibleLeftMargin 调整左侧间距
UIViewAutoresizingFlexibleRightMargin 调整右侧间距
UIViewAutoresizingFlexibleTopMargin 调整顶部间距
UIViewAutoresizingFlexibleBottomMargin 调整底部间距
UIViewAutoresizingFlexibleWidth 调整宽度
UIViewAutoresizingFlexibleHeight 调整高度 )
坐标变换:
convertPoint:toView:
convertRect:toView:
convertPoint:fromView:
convertRect:fromView:
UIView的状态监视
UIView追加子元素后: - (void) didAddSubview: (UIView*) subview
UIView删除子元素前: - (void)willRemoveSubview: (UIView*) subview
UIView作为UIView子元素被追加/删除前: - (void)willMoveToSurperview:(UIView*)newSurperview
UIView作为UIView子元素被追加/删除后: - (void)didMobeToSurperview
UIView作为UIWindow子元素被追加/删除前: - (void)willMoveToWindow:(UIWindow*)newWindow
UIView作为UIWindow子元素被追加/删除后: -(void) didMoveToWindow
相关文章推荐
- IOS学习笔记10-UIView的一些基本方法理解:loadView、viewDidLoad、viewDidUnload、viewWillAppear、viewWillDisappear、
- IOS学习 模拟UIView的hitTest:方法和pointInside:方法的实现
- iOS学习之——UIView的setNeedsDisplay和setNeedsLayout方法
- iOS学习——UIView圆角图片的设置方法
- iOS学习之UI初级————UIView的概念属性以及相关方法
- iOS学习笔记--UIView的常见属性及方法,UIViewAnimationWithBlocks
- iOS 开发学习之 User Interface(4)UIView 与 UIViewController【二】
- OC基础:OC 基本数据类型与对象之间的转换方法 分类: ios学习 OC 2015-06-18 20:01 11人阅读 评论(0) 收藏
- IOS学习笔记(三)之UIView的标签(UILabel)与按钮(UIButton)
- iOS学习笔记17—NSFileHandle 诸多方法理解
- IOS学习之UISwitch控件两种使用方法和监听
- iOS开发学习_OC基础_(一).类、对象和方法(1)
- IOS学习笔记56-IOS7状态栏适配方法一
- iOS阶段学习第28天笔记(UIView的介绍)
- 【IOS 开发学习总结-OC-9】★ objective-c面向对象之——方法
- iOS绘图机制和UIView相关方法调动时机
- 【IOS 开发学习总结-OC-12】★objective-c面向对象之——合成存取方法与点语法
- iOS设置圆形(圆角)UIView、UIButton的简单方法
- IOS--UIViewUIButtonUIImageView设置圆角、阴影、边框的方法
- iOS学习之——类方法和对象方法的区别