As the title, I wanna to judge a UILabel
is completely show its content.
Such as, if I set the UILabel
numberOfLines
to be 2,maybe its content can arrive its end,maybe not,how can I judge that?
Asked
Active
Viewed 53 times
0

lme
- 59
- 3
- 17
-
you can use sizeToFit property of UILabel and make number of Line = 0 – Nitin Gohel May 25 '16 at 08:55
-
3Possible duplicate of [How to check if UILabel is truncated?](http://stackoverflow.com/questions/3077109/how-to-check-if-uilabel-is-truncated) – Rajesh May 25 '16 at 09:02
-
http://stackoverflow.com/questions/3077109/how-to-check-if-uilabel-is-truncated/24508153#24508153 – Rajesh May 25 '16 at 09:02
1 Answers
0
My code will help you
titleLable.minimumScaleFactor = 0.5;
[titleLable sizeToFit];

Vidhi Patel
- 603
- 5
- 10
-
Maybe I give a misunderstand information, I mean if the UILabel cannot contains the content, return NO,if not return YES. – lme May 26 '16 at 01:50
-
You can also change to numberOfLines to 0,it means you can give number of line content than display label content properly – Vidhi Patel May 26 '16 at 04:19
-
U did not understand my meaning,I just want to know is a label (which is fixed frame)is can contain all its content ? – lme May 26 '16 at 08:41
-