0

enter image description here

In the above figure it shows...

I need to display complete data in UILabel.

This is an alignment problem with UILabel

UILabel *lable=[[UILabel alloc]init];
lable.frame=CGRectMake(350, 25, 50, 50);
[lable setTextColor:[UIColor whiteColor]];
[lable setBackgroundColor:[UIColor clearColor]];
[lable setText:@"Leveraged Commentary & Data"];

I need to display completed setText on lable @"Leveraged Commentary & Data";

Please help me out.

Thanks in advance

Matteo Alessani
  • 10,264
  • 4
  • 40
  • 57
kiran kumar
  • 1,349
  • 4
  • 21
  • 40
  • put lable.textAlignment=UITextAlignmentLeft; also set the lable.frame=CGRectMake(350, 25, increase this value, 50); – NIKHIL May 12 '11 at 10:07

4 Answers4

3
UILabel *lable=[[UILabel alloc]init];

lable.frame=CGRectMake(350, 25, increase this value , 50);
[lable setTextColor:[UIColor whiteColor]];
[lable setBackgroundColor:[UIColor clearColor]];
[lable setText:@"Leveraged Commentary & Data"];

You need to increase the width of the label

NIKHIL
  • 2,719
  • 1
  • 26
  • 50
1

You can do two things for display complete text.

1) Increase the width of UILabel.

2) Increase the height and set no of lines.

Chetan Bhalara
  • 10,326
  • 6
  • 32
  • 51
0

Can you increase the label width. Label is too small to display the text.Try this

lable.frame=CGRectMake(350, 25, 350, 50);
lable.adjustsFontSizeToFitWidth = NO;
PgmFreek
  • 6,374
  • 3
  • 36
  • 47
0

Make your label's frame wider, it's only 50 points according to your code. NSString has a method sizeWithFont:forWidth:lineBreakMode: which allows you to get the dimensions of the text.

Here's a similar question with an accepted answer.

Community
  • 1
  • 1
Alexei Sholik
  • 7,287
  • 2
  • 31
  • 41