We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
YYtextView插入YYImage 崩溃,目前只在iOS7发现有此问题
我的代码,运行到最后一句崩溃:
YYImage *image = [[YYImage alloc] initWithCGImage:[[asset defaultRepresentation] fullScreenImage]]; DGCloseImageView *imageView = [[DGCloseImageView alloc] initWithImage:image]; imageView.url = ast.url; imageView.delegate = self; CGFloat width = kScreenWidth - 8*2; CGFloat height = image.size.height * width / image.size.width; CGSize size = CGSizeMake(width, height); NSMutableAttributedString *attachText = [NSMutableAttributedString yy_attachmentStringWithContent:imageView contentMode:UIViewContentModeScaleAspectFill attachmentSize:size alignToFont:KFont alignment:YYTextVerticalAlignmentCenter]; attachText.yy_font = KFont; attachText.yy_minimumLineHeight = 30; [attachText yy_insertString:@"\n" atIndex:0]; [attachText yy_appendString:@"\n"]; NSRange range = _textView.selectedRange; NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithAttributedString:_textView.attributedText]; [attr insertAttributedString:attachText atIndex:range.location]; _textView.attributedText = attr;
崩溃在 YYTextEffectWindow.m 文件如下代码:
CGPoint center = [dot yy_convertPoint:CGPointMake(CGRectGetWidth(dot.frame) / 2, CGRectGetHeight(dot.frame) / 2) toViewOrWindow:self]; dot.mirror.center = center;
应该是计算出来的frame有问题: center = (x = NaN, y = NaN)
The text was updated successfully, but these errors were encountered:
fix potential crash in iOS7: #261
a358681
Fixed.
Sorry, something went wrong.
No branches or pull requests
YYtextView插入YYImage 崩溃,目前只在iOS7发现有此问题
我的代码,运行到最后一句崩溃:
崩溃在 YYTextEffectWindow.m 文件如下代码:
应该是计算出来的frame有问题:
center = (x = NaN, y = NaN)
The text was updated successfully, but these errors were encountered: