pptk |
| 问与答 • pptk 请问一下,谁有获取职业相关技能的接口或者方法 2020 年 12 月 1 日 • 最后回复来自 sadfQED2 | 1 |
| iOS • pptk 请问一下有人遇到过 CAGradientLayer 无法截图的问题 2020 年 11 月 16 日 • 最后回复来自 pptk | 1 |
| 问与答 • pptk 想问一下原生 iOS 知道文件的 url,如何把文件内容转换成 file 的形势给 js 2020 年 2 月 24 日 • 最后回复来自 randyo | 5 |
| V2EX • pptk iOS 或者 Android,同一个页面, UIScrollView/ScrollView,需要同时添加 2000 甚至更多的 View,请问有什么办法让他操作更顺畅? 2019 年 4 月 16 日 • 最后回复来自 lizhuoli | 1 |
pptk 最近回复了
| 回复了 pptk 创建的主题 › 请问一下有人遇到过 CAGradientLayer 无法截图的问题2020 年 11 月 17 日 |
已解决
//绘制渐变
UIColor *firstColor = [[UIColor alloc]initWithCGColor:(CGColorRef)self.bgLayer.colors.firstObject];
UIColor *lastColor = [[UIColor alloc]initWithCGColor:(CGColorRef)self.bgLayer.colors.lastObject];
//创建一个 RGB 的颜色空间
CGColorSpaceRef rgb = CGColorSpaceCreateDeviceRGB();
//定义渐变颜色数组
CGFloat colors[] = {
firstColor.qmui_red, firstColor.qmui_green, firstColor.qmui_blue, 1.00,
lastColor.qmui_red, lastColor.qmui_green, lastColor.qmui_blue, 1.00
};
CGGradientRef _gradient = CGGradientCreateWithColorComponents(rgb, colors, NULL, sizeof(colors)/(sizeof(colors[0])*4));
UIGraphicsBeginImageContextWithOptions(self.preImage.size, NO, self.preImage.scale);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextInspectContext(context);
CGPoint start = CGPointMake(self.preImage.size.width/2, 0);
CGPoint end = CGPointMake(self.preImage.size.width/2, self.preImage.size.height);
CGContextDrawLinearGradient(context, _gradient, start, end, kCGGradientDrawsBeforeStartLocation);
CGImageRef imageRef = self.preImage.CGImage;
CGImageRef subImageRef = CGImageCreateWithImageInRect(imageRef,CGRectMakeWithSize(self.preImage.size));
CGContextDrawImage(context, CGRectMakeWithSize(self.preImage.size), subImageRef);
UIImage *imageOut = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
//绘制渐变
UIColor *firstColor = [[UIColor alloc]initWithCGColor:(CGColorRef)self.bgLayer.colors.firstObject];
UIColor *lastColor = [[UIColor alloc]initWithCGColor:(CGColorRef)self.bgLayer.colors.lastObject];
//创建一个 RGB 的颜色空间
CGColorSpaceRef rgb = CGColorSpaceCreateDeviceRGB();
//定义渐变颜色数组
CGFloat colors[] = {
firstColor.qmui_red, firstColor.qmui_green, firstColor.qmui_blue, 1.00,
lastColor.qmui_red, lastColor.qmui_green, lastColor.qmui_blue, 1.00
};
CGGradientRef _gradient = CGGradientCreateWithColorComponents(rgb, colors, NULL, sizeof(colors)/(sizeof(colors[0])*4));
UIGraphicsBeginImageContextWithOptions(self.preImage.size, NO, self.preImage.scale);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextInspectContext(context);
CGPoint start = CGPointMake(self.preImage.size.width/2, 0);
CGPoint end = CGPointMake(self.preImage.size.width/2, self.preImage.size.height);
CGContextDrawLinearGradient(context, _gradient, start, end, kCGGradientDrawsBeforeStartLocation);
CGImageRef imageRef = self.preImage.CGImage;
CGImageRef subImageRef = CGImageCreateWithImageInRect(imageRef,CGRectMakeWithSize(self.preImage.size));
CGContextDrawImage(context, CGRectMakeWithSize(self.preImage.size), subImageRef);
UIImage *imageOut = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
| 回复了 luckyrayyy 创建的主题 › MacOS 的磁盘格式这么强?复制到移动硬盘上大了好多2020 年 8 月 26 日 |
@luckyrayyy 已解决,直接抹掉移动硬盘,修改硬盘文件格式为 APFS 即可。
| 回复了 luckyrayyy 创建的主题 › MacOS 的磁盘格式这么强?复制到移动硬盘上大了好多2020 年 8 月 26 日 |
@luckyrayyy 我特么的拉个 xcode 进去 512G 的移动硬盘直接剩下 30G...这...
| 回复了 luckyrayyy 创建的主题 › MacOS 的磁盘格式这么强?复制到移动硬盘上大了好多2020 年 8 月 26 日 |
大哥,最后怎么解决的啊
| 回复了 pptk 创建的主题 › 想问一下原生 iOS 知道文件的 url,如何把文件内容转换成 file 的形势给 js2020 年 2 月 25 日 |
@randyo sheetjs 可以直接打开 base64 吗?我不太会 js,整个 demo 和操作都是扒的 sheetjs 网站上的 demo 修修改搞的
| 回复了 pptk 创建的主题 › 想问一下原生 iOS 知道文件的 url,如何把文件内容转换成 file 的形势给 js2020 年 2 月 24 日 |
@randyo 这里的 url,指的是手机本地的文件地址哈,我没有描述清楚