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
optimumSize crashes, with: code=EXC_ARM_BREAKPOINT, subcode=0xdefe
label content is: "ENERGIEWENDE IN DEUTSCHLAND" Here is the code (sorry for junk code):
RTLabel *tv = [[RTLabel alloc] init]; if([contentElement attributeNamed:@"line-height"]){ [tv setLineSpacing:[[contentElement attributeNamed:@"line-height"] floatValue]]; } [tv setText:[contentElement value]]; if([contentElement attributeNamed:@"line-height"]){ [tv setLineSpacing:[[contentElement attributeNamed:@"line-height"] floatValue]]; } [tv setTag:[[contentElement attributeNamed:@"id"] intValue]]; [tv setTranslatesAutoresizingMaskIntoConstraints:NO]; UIFont *font; if(fontName && [contentElement attributeNamed:@"size"]){ font = [UIFont fontWithName:fontName size:[[contentElement attributeNamed:@"size"] intValue]]; }else{ font = [UIFont fontWithName:fontName size:16]; } [tv setFont:font]; if([[contentElement attributeNamed:@"align"] isEqualToString:@"left"]){ tv.textAlignment = NSTextAlignmentLeft; }else if([[contentElement attributeNamed:@"align"] isEqualToString:@"right"]){ tv.textAlignment = NSTextAlignmentRight; }else{ tv.textAlignment = NSTextAlignmentLeft; } if([contentElement attributeNamed:@"color"]){ unsigned result = 0; NSScanner *scanner = [NSScanner scannerWithString:[contentElement attributeNamed:@"color"]]; [scanner scanHexInt:&result]; UIColor *color = UIColorFromRGB(result); if(invertedColors){ [tv setTextColor:[color inverseColor]]; }else{ [tv setTextColor:color]; } }else{ if(invertedColors){ [tv setTextColor:[UIColor whiteColor]]; }else{ [tv setTextColor:[UIColor blackColor]]; } } [tv setBackgroundColor:[UIColor clearColor]]; tv.lineBreakMode = NSLineBreakByWordWrapping; // or some other desired wrapping if(width == 350){ CGRect frame = CGRectMake(0, 0, 350 - [[pageContent attributeNamed:@"margin"] floatValue], 9999); // oversized height tv.frame = frame; }else{ CGRect frame = CGRectMake(0, 0, 1024, 9999); // oversized height tv.frame = frame; } [containerView addSubview:tv]; CGSize optimumSize = [tv optimumSize];
The text was updated successfully, but these errors were encountered:
I am also facing same problem. have to found any solution
Sorry, something went wrong.
I had the same issue, found solution after initialization of RTlLabel with frame of height 100.
RTLabel *yourLabel = [[RTLabel alloc] initWithFrame:CGRectMake(0,0,100,100)]; then assign text n get optimize height and update frame of yourLabel.
Same problem here.
No branches or pull requests
optimumSize crashes, with: code=EXC_ARM_BREAKPOINT, subcode=0xdefe
label content is: "ENERGIEWENDE IN DEUTSCHLAND"
Here is the code (sorry for junk code):
The text was updated successfully, but these errors were encountered: