1

I have a label, if i add text to label it added one extra space at the beginning of the text, app supports only portrait orientation. tried following solutions but no use. attached images for reference.

I have created this label in xib with number of lines 2 with constrains leading, trailing, bottom space to container, height is not fixed,

and set text like

dealName.text = "Cup of Coffee with A asdf asd asdf adsf ads fad"

UILabel extra spaces before and after text ios

UIlabel shows extra space before text

UILabel with multiple lines

Screen Shot

UILabel with single line

Screen Shot

Sham Dhiman
  • 1,348
  • 1
  • 21
  • 59
naresh
  • 627
  • 1
  • 7
  • 28

1 Answers1

0

try this may be there is an any white space before character this will remove this..

NSString *trimmed = [yourstring stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];

yourlable.text = trimmed;

OR

Also see if you set attribute paragraph spacing from here..

enter image description here

Dipen Chudasama
  • 3,063
  • 21
  • 42