qinqi777 / qqcorner Goto Github PK
View Code? Open in Web Editor NEW给 UIView 或 UIImage 高性能添加(之后可以修改)圆角,生成渐变色图片等
License: MIT License
给 UIView 或 UIImage 高性能添加(之后可以修改)圆角,生成渐变色图片等
License: MIT License
如题,无效的上下文.
for example:
- (UIView *)smartKeyFootView
{
UIView *footView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, MAIN_SIZE.width, RELATIVE_HEIGHT(10))];
UIView *helfCornerView = [[UIImageView alloc]init];
helfCornerView.frame = CGRectMake(RELATIVE_WIDTH(16.5), 0, RELATIVE_WIDTH(342), RELATIVE_HEIGHT(6));
helfCornerView.sakura.backgroundColor(@"Global.circularCellBackgroundColor");
[footView addSubview:helfCornerView];
[helfCornerView updateCornerRadius:^(QQCorner *corner) {
corner.radius = QQRadiusMake(0, 0, RELATIVE_HEIGHT(6), RELATIVE_HEIGHT(6));
}];
return footView;
}
上面的uiviwe就是用于在- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
中返回视图的.
一般报警会有两句话:
2019-02-12 14:53:16.144824+0800 IsolatedSecond[8464:2267719] [Unknown process name] CGContextAddPath: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
2019-02-12 14:53:16.144873+0800 IsolatedSecond[8464:2267719] [Unknown process name] clip: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
在cell复用的时候,比如对话CELL
发送方我使用渐变背景
接收方我使用非统一圆角边框
因此想问问有没有方式方便地取消圆角边框
避免复用的时候出错
谢谢你
很棒的库
[Unknown process name] clip: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
cell中有 view,cell屏幕宽。不会按照实际的屏幕去 trailing Space to。 计算view的宽度按照xib内cell设置的大小(如320- trailing Space to)。
我在 collectionviewcell 中套用了一个横向展示的 collectionview ,当在横向 collectionviewcell 使用 updateCornerRadius 时是生效了,但是,当滑动后,就导致updateCornerRadius 失效了,之前的圆角都没有了,请大佬解惑,目前我还没找到办法解决
- (UIImage *)imageWithQQCorner:(void (^)(QQCorner *))handler size:(CGSize)size {
QQCorner *corner = [[QQCorner alloc] init];
if (handler) {
handler(corner);
}
if (!corner.fillColor) {
corner.fillColor = [UIColor clearColor];
}
UIBezierPath *path = qq_pathWithCornerRadius(corner.radius, size);
if (@available(iOS 10.0, *)) {
UIGraphicsImageRenderer *render = [[UIGraphicsImageRenderer alloc] initWithSize:size];
return [render imageWithActions:^(UIGraphicsImageRendererContext * _Nonnull rendererContext) {
CGContextSetStrokeColorWithColor(rendererContext.CGContext, corner.borderColor.CGColor);
CGContextSetFillColorWithColor(rendererContext.CGContext, corner.fillColor.CGColor);
CGContextSetLineWidth(rendererContext.CGContext, corner.borderWidth);
[path addClip];
CGContextAddPath(rendererContext.CGContext, path.CGPath);
CGContextDrawPath(rendererContext.CGContext, kCGPathFillStroke);
}];
} else {
UIGraphicsBeginImageContext(size);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetStrokeColorWithColor(context, corner.borderColor.CGColor);
CGContextSetFillColorWithColor(context, corner.fillColor.CGColor);
CGContextSetLineWidth(context, 1); <--- here
这里没有使用corner.borderWidth,应该是不对的吧?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.