将一个View保存为PNG保存到本地1.首先写一个UIImage的分类,加入这个方法。+ (UIImage *)imageWithView:(UIView *)view { UIGraphicsBeginImageContextWithOptions(view.bounds.size, vie...
分类:
其他好文 时间:
2015-06-15 12:59:52
阅读次数:
97
CGRect rect = [UIScreen mainScreen].bounds; ? ? _friendsCircleTitleView = [[UIView alloc] initWithFrame:CGRectMake(0, 0,140, 44)]; ? ? _friendsCircleTitleView.backgroundColor = [UIColor clearCo...
分类:
移动开发 时间:
2015-06-14 21:30:38
阅读次数:
449
/********* UIView是iOS系统界面元素的基础,所有的界面元素都是集成自它。它本身完全是由CoreAnimation来实现的。它真正的绘图部分,是一个叫CALayer(Core Animation Layer)的类来管理的。UIView本身,更像是一个CALayer的管理器
,访问它的跟绘图和跟坐标有关的属性,例如frame,bounds等等,实际上内部都是在访问它所包含的CALa...
UIView/UIWindow/UIScreen/CALayer1、UIScreen可以获取设备屏幕的大小。1234567// 整个屏幕的大小 {{0, 0}, {320, 480}}CGRect bounds = [UIScreen mainScreen].bounds;NSLog(@"UIScr...
分类:
移动开发 时间:
2015-06-09 23:17:41
阅读次数:
280
很简单,用遮罩,代码如下:UIBezierPath *maskPath= [UIBezierPath bezierPathWithRoundedRect:viewRadius.bounds byRoundingCorners:UIRectCornerBottomLeft|UIRectCornerB....
分类:
移动开发 时间:
2015-06-09 19:15:24
阅读次数:
134
添加UIVisualEffectViewby 伍雪颖let bgView : UIImageView = UIImageView(image: UIImage(named: "1.jpg"))
bgView.frame = self.view.bounds
self.view.addSubview(bgView)let blurEffect: UIBlurEffect = UIBlurEffect(...
分类:
其他好文 时间:
2015-06-09 11:49:28
阅读次数:
107
UIImageView* imageView = [[UIImageView alloc] initWithFrame:self.view.bounds]; imageView.image = [UIImage imageNamed:@"背景灰.png"]; self.vi...
分类:
移动开发 时间:
2015-06-08 19:17:43
阅读次数:
146
//获取屏幕的宽度
#define kScreenWidth [UIScreen mainScreen].bounds.size.width
#define kScreenHeight [UIScreen mainScreen].bounds.size.height
//判断时iPhone几
#define kDoubleMargin 0.00001
#def...
分类:
其他好文 时间:
2015-06-05 15:50:19
阅读次数:
121
记录下显示动画的部分基本属性:
opacity
transform.scale
transform.scale.x
transform.scale.y
transform.rotation.z
margin
zPosition
backgroundColor
cornerRadius
borderWidth
bounds
contents
contentsRect
co...
分类:
其他好文 时间:
2015-06-05 10:18:06
阅读次数:
138
CAlayer(创建图层)一、添加一个图层添加图层的步骤:1.创建layer2.设置layer的属性(设置了颜色,bounds才能显示出来)3.将layer添加到界面上(控制器view的layer上) 1 // 2 // YYViewController.m 3 // 01-创建一个简单的图层 .....
分类:
移动开发 时间:
2015-06-04 22:31:27
阅读次数:
237