非常easy的一句代码 self.view.backgroundColor = UIColor.clearColor() 由此联想开来,非常多的控件想设置为背景透明都能够用UIColor.clearColor() 非常easy的一句代码 self.view.backgroundColor = UIC ...
分类:
编程语言 时间:
2017-08-12 10:19:05
阅读次数:
180
You will want to use the [UIImage imageWithContentsOfFile:@""] method, as that doesn't cache images. imageNamed: caches any images that are loaded thr ...
分类:
其他好文 时间:
2017-08-04 20:32:47
阅读次数:
113
1.每一个View都自带一个CALayer,称为rootLayer,layer能够和实现与View一样的显示功能,可是它不继承UIResponse,也就是说它无法处理事件,所以为了处理事件还是要用View,假设仅仅是显示,能够选择layer。 以下的代码实现了自己定义一个layer加入到控制器的ro ...
分类:
其他好文 时间:
2017-08-04 19:30:00
阅读次数:
146
图片加水印效果的实现并保存至相冊 实现效果如图: project下载:githubproject下载链接 代码: - (void)viewDidLoad { [super viewDidLoad]; UIImage *image = [UIImage imageNamed:@"pushu.jpg"] ...
分类:
移动开发 时间:
2017-08-04 10:10:28
阅读次数:
271
1.name xib的名字 owner当前类对象 options初始参数 实际应用: nibs[0]是当前view的对象 nibs[1]当前view的背景 ,我们可以在init中对当前frame以及当前view的背景的frame进行赋值, nibs[1]的背景是半透明的,如果当前的xib是View, ...
分类:
其他好文 时间:
2017-08-03 12:30:45
阅读次数:
485
oc版本号 //万花筒模式 + (CGImageRef) getKaleidoscope:(CIContext *)context { CIImage * image = [CIImage imageWithCGImage:[UIImage imageNamed:@"Icon"].CGImage]; ...
分类:
编程语言 时间:
2017-07-31 12:31:48
阅读次数:
225
ViewController.h #import <UIKit/UIKit.h> @interface ViewController : UIViewController { UIImage *_image; NSInteger _index; } @endViewController.m #imp ...
分类:
其他好文 时间:
2017-07-25 16:00:52
阅读次数:
127
- (UIColor *)colorAtPixel:(CGPoint)point { // Cancel if point is outside image coordinates if (!CGRectContainsPoint(CGRectMake(0.0f, 0.0f, self.size.w ...
分类:
移动开发 时间:
2017-07-24 10:06:43
阅读次数:
198
直接上代码: // // AppDelegate.m // // #import "AppDelegate.h" #import "RootViewController.h" #import "FirstViewController.h" #import "SecnodViewController. ...
分类:
其他好文 时间:
2017-07-23 13:30:16
阅读次数:
191