Referring Image number 1: In ios 6 and 5, the label get display properly in UItable.
Referring Image number 2: In IOS 7, the label do not get display in UItable.
Referring Image number 3: In iOS 7, the label get display on click of cell in UItable.
Below is the code used to write cell in UItable.
-(UILabel *)createLabel:(UILabel *)sender1 :(int)x :(int)y :(NSString *)title :(int)size :(int)swidth :(int)ht { sender1 = [[UILabel alloc] initWithFrame:CGRectMake(x, y, swidth, ht)]; sender1.text = title; [sender1 setTextColor:[UIColor whiteColor]]; [sender1 setBackgroundColor:[UIColor clearColor]]; [sender1 setFont:[UIFont systemFontOfSize:size]]; sender1.numberOfLines = 2; //7 sender1.lineBreakMode = NSLineBreakByWordWrapping; sender1.contentMode = UIControlContentVerticalAlignmentCenter; return sender1; }
I am sure it is not simulator issue.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
- The issue was with the default background colour of the cell.
In Ios 6 and 5 it use to set black but in Ios 7 it is set to White.
[cell setBackgroundColor:[UIColor blackColor]]; is the solution.