In my project, there is a UILabel with text. The font size is 16pt. The text contents are changed depending on different cases. I hope it can automatically adju
UILabel
Follow this.
CGSize stringsize = [yourString sizeWithFont:[UIFont systemFontOfSize:fontSize]]; [label setFrame:CGRectMake(x,y,stringsize.width,height)]; [label setText: yourString];