0

I am having OHAttributedLable like following

    lblHeaderTitle =[[OHAttributedLabel alloc]init];
    [lblHeaderTitle setBackgroundColor:[UIColor clearColor]];
    [lblHeaderTitle setFrame:CGRectMake(15, 8,(WidthForBoldText(txt1))+45, height)];

    //[lblHeaderTitle setNumberOfLines:2];
    [lblHeaderTitle setLineBreakMode:UILineBreakModeTailTruncation];
    [lblHeaderTitle setNumberOfLines:0];
    lblHeaderTitle.attributedText = attrStr;

it is displaying all in one line and remaining part is not visible

now the problem is that i am not able to wrap or truncate text in this lable can anybody help me with this. what i want is if my text is

"Abcdefghijklmnopqrstuvwxyz" then it will display

"Abcdefghijklmn..." or

"Abcdefghijklmn

opqrstuvwxyz"

anything will work.

Thanks in advance.

Anand
  • 1,129
  • 7
  • 29

1 Answers1

0
lableName.numberOfLines = 0;

lableName.lineBreakMode = UILineBreakModeWordWrap;
sth
  • 222,467
  • 53
  • 283
  • 367
Ravi patel
  • 76
  • 1
  • 9