当一个TableCell中有lable,想要旋转这个label,如果这个label 是从xib中加载过来的, 最开始显示的时候,都是没有旋转的,只有当滑动,重新加载这个cell的时候,label才会旋转,
解决办法:
手动添加lable,而不是从xib中加,
UILabel *label = [[UILabel alloc ] initWithFrame:CGRectMake(284*[UIScreen mainScreen].bounds.size.width/320, (115-103)/2, 28, 103)];
[self.contentView addSubview:label];
//旋转90度
label.transform = CGAffineTransformMakeRotation(M_PI_2);
//还需要重新设置frame
CGRect frame = label.frame;
frame = CGRectMake(284*[UIScreen mainScreen].bounds.size.width/320, (115-103)/2, 28, 103);
label.frame = frame;