我在UITableCell中有一個UILabel,當我使標籤的背景透明時,我得到了這些奇怪的鬼字符(見下圖),看起來很糟糕。這裏是我的代碼:用透明背景打印NSInteger時出現UILabel重影
左:
UILabel *unreadLabel = [[UILabel alloc] initWithFrame:CGRectMake(270, 7, 25, 25)];
unreadLabel.text = [NSString stringWithFormat:@"%d", source.unreadCount];
unreadLabel.textColor = [UIColor colorWithWhite:100.0f/255.0f alpha:1.0];
unreadLabel.font = [UIFont systemFontOfSize:11.0f];
[cell addSubview:unreadLabel];
[unreadLabel release];
權是一樣的離開,但這種補充說:
unreadLabel.backgroundColor = [UIColor colorWithWhite:1.0 alpha:0.0];
UnreadCount是NSInteger的。