ios - UILabel text issue -


i have issue label text. label text not dislay text thats get. put nslog , able see text, label reasom cant.

my code:

-(void)viewdidload {      [super viewdidload];      [_scroller setscrollenabled:yes];     [_scroller setcontentsize:cgsizemake(250, 420)];      self.description = [_description stringbytrimmingcharactersinset:[nscharacterset whitespaceandnewlinecharacterset]];      if ([self.description isequaltostring:@""]) {         self.description = @"ללא תקציר";     }     [self positionlabel:self.lbltitle withtext:self.stitle withy:10];     [self positionlabel:self.lblpubdate withtext:self.pubdate withy:cgrectgetmaxy(self.lbltitle.frame)+10 ];     [self positionlabel:self.lbldescription withtext:self.description withy:cgrectgetmaxy(self.lblpubdate.frame)+25 ];  -(void)positionlabel:(uilabel*)lbl withtext:(nsstring*)text withy:(cgfloat)y {     lbl.textalignment = uitextalignmentright;     lbl.text = text;     lbl.numberoflines = 0;     lbl.linebreakmode = uilinebreakmodewordwrap;     cgsize size = [self calculatesize:lbl];     [lbl setframe:cgrectmake(10 , y , (size.width>300)?size.width:300 , size.height)];     [_scroller addsubview:lbl];  }  -(cgsize)calculatesize:(uilabel*)lbl {     cgsize size = [lbl.text sizewithfont:lbl.font                        constrainedtosize:cgsizemake(280, maxfloat)                            linebreakmode:uilinebreakmodewordwrap];     return size; } 

edit

here nslog text:

enter image description here

and uilabel text:

enter image description here

the marked text @ nslog missing uilabel.. sorry language.

what cause problem? gooing crazy, tried everything!! in advance!

there few reasons why label won't display text

  1. frame size, looks cover especaily since can see of text
  2. the font/size/wording big , in turn doesn't have enough space show text.

in case suggest looking @ font or font size.


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

What is the difference between data design and data model(ERD) -

ios - Can NSManagedObject conform to NSCoding -