标签:
//初始化
UIView *view=[[UIView alloc]initWithFrame:CGRectMake(100, 100, 100, 100)];
//背景颜色
view.backgroundColor=[UIColor redColor];
//透明度
view.alpha=1;
//缩放样式
view.contentMode=UIViewContentModeScaleAspectFill;
UIViewContentModeScaleToFill //左右缩放,上下不变 UIViewContentModeScaleAspectFit //等比例缩放,大小不超过view UIViewContentModeScaleAspectFill // 等比例缩放,大小此超过边框
//将view添加到window
[self.window addSubview:view];
//将view移动到最前
[self.window bringSubviewToFront:view];
//将视图移到幕后
[self.window sendSubviewToBack:view];
//将view从父视图移除
[self.window removeFromSuperview];
坐标系统变换
UIView *view=[self.window viewWithTag:10];
CGAffineTransform transform=view.transform;
//对视图比例缩放 view.transform=CGAffineTransformScale(transform, 0.5, 0.5);
//对视图变焦旋转 view.transform=CGAffineTransformRotate(transform, 0.33);
//对视图在原来的位置上左平移 view.transform=CGAffineTransformTranslate(transform, 1, 1);
标签:
原文地址:http://www.cnblogs.com/kyuubee/p/4803714.html