Closed sambudda closed 8 years ago
This is definitively a known issue. THLabel is using Core Text for drawing and I'm not aware of a simple solution like UILabel's adjustsFontSizeToFitWidth
or minimumScaleFactor
. Also numberOfLines
is being ignored by THLabel. I'll look into this issue again, but I couldn't find anything the last time. The solution for now is probably to set a fixed lower font size.
Does THLabel support adjustsFontSizeToFitWidth?
As I've mentioned unfortunately not, sorry.
I have defined a THLabel programmatically as follows.
THLabel *labelValue4 = [[THLabel alloc] initWithFrame:CGRectMake(20,269,300,85)]; labelValue4.text = @"Spectacular"; labelValue4.font = [UIFont fontWithName:@"Arial Rounded MT Bold" size: 57.0]; labelValue4.textColor = [UIColor colorWithRed:52/255.f green:152/255.f blue:255/255.f alpha:1.0]; labelValue4.textAlignment = NSTextAlignmentLeft; labelValue4.numberOfLines = 1; labelValue4.backgroundColor = [UIColor clearColor]; labelValue4.strokeColor = [UIColor blackColor]; labelValue4.strokeSize = 1.0; [self.view addSubview:labelValue4];
What I want is if the word is large like "spectacular" then it should adjust the size of the font automatically but it doesn't. It just chops off the word. How can I fix that? By the way really nice with THLabel.![ios simulator screen shot sep 26 2014 5 47 47 pm](https://cloud.githubusercontent.com/assets/3536867/4428092/592d8920-45c7-11e4-8e03-a2e3f420fe89.png)
Or I get this for labelValue4.text = @"Partly Cloudy"; dot dot dot![ios simulator screen shot sep 26 2014 6 10 30 pm](https://cloud.githubusercontent.com/assets/3536867/4428312/d1ef3c52-45ca-11e4-9656-30c11450b017.png)